-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TG Error: Cannot read properties of undefined (reading 'isMap') on mobile #307
Comments
me too, i use https://open.bigmodel.cn/api/paas/v4/chat/completions android 12,obsidian 1.6.7 |
Looking at the source code,
17 import { isMap, isSet } from "util/types";
18 import Read from "#/extractors";
42 splitters: langchain.splitters,
43 isMap,
44 isSet,
21 } from "#/extractors/content-extractor";
22 import { isMap, isSet } from "util/types";
23 import Read from "#/extractors";
121 }
122 } else if (isMap(context)) {
123 const j = context.size; #175 looks a bit similar, and is marked Won't Fix. Also, @BlaisePx used ADB to get to the browser console to get a full traceback. I've never done that, so need to research the steps needed. The error text I'm not a JavaScript guru, so this is how far I got while trying to help by taking a look at the problem. |
I managed to get to the Obsidian app console through ADB (using chrome://inspect), and see the traceback attached. Looking at the debugger on the line async function IX(I, e) {
let t, l = {
JSON5: WTe.default,
lodashGet: hTe.default,
lodashSet: ZTe.default,
pluginApi: IU,
Notice: bue.Notice,
pull: Hz,
langchain: hde,
splitters: Wy,
isMap: dM.isMap, // <-- this seems to be the problem
isSet: dM.isSet,
globalThis: {},
...e, Here's the traceback: app.js:1 Capacitor plugin "Keyboard" already registered. Cannot register plugins twice.
T.m @ app.js:1
/favicon.ico:1
Failed to load resource: the server responded with a status of 404 (Not Found)
app.js:1 Obsidian Developer Console
plugin:review-obsidian:856 Loading the Review plugin v1.6.5.
plugin:leader-hotkeys-obsidian:1006 Leader Hotkeys: Started Loading.
plugin:leader-hotkeys-obsidian:1006 Leader Hotkeys: Loading previously saved settings.
plugin:leader-hotkeys-obsidian:1006 Leader Hotkeys: Loaded previous settings.
plugin:leader-hotkeys-obsidian:1006 Leader Hotkeys: Registering necessary event callbacks
plugin:leader-hotkeys-obsidian:1006 Leader Hotkeys: Registered workspace "keydown" event callbacks.
plugin:leader-hotkeys-obsidian:1006 Leader Hotkeys: Registered open modal command
plugin:leader-hotkeys-obsidian:1006 Leader Hotkeys: Registered Setting Tab.
plugin:leader-hotkeys-obsidian:1006 Leader Hotkeys: Finished Loading.
plugin:emacs-text-editor:54 loading plugin: Emacs text editor
plugin:url-into-selection:690 loading url-into-selection
plugin:obsidian-textgenerator-plugin:2098 attempting to get files 30
plugin:obsidian-textgenerator-plugin:1999 Object
plugin:obsidian-textgenerator-plugin:1997 calling stream generate
plugin:obsidian-textgenerator-plugin:1997 the request Object
plugin:obsidian-textgenerator-plugin:2098 TypeError: Cannot read properties of undefined (reading 'isMap')
at IX (plugin:obsidian-textgenerator-plugin:1805:16563)
at I.request (plugin:obsidian-textgenerator-plugin:1958:70)
at async eval (plugin:obsidian-textgenerator-plugin:1962:422)
handelError @ plugin:obsidian-textgenerator-plugin:2098
plugin:obsidian-textgenerator-plugin:2098 TypeError: Cannot read properties of undefined (reading 'isMap')
at IX (plugin:obsidian-textgenerator-plugin:1805:16563)
at I.request (plugin:obsidian-textgenerator-plugin:1958:70)
at async eval (plugin:obsidian-textgenerator-plugin:1962:422)
handelError @ plugin:obsidian-textgenerator-plugin:2098
plugin:obsidian-textgenerator-plugin:1999 Object
plugin:obsidian-textgenerator-plugin:1997 calling stream generate
plugin:obsidian-textgenerator-plugin:1997 the request Object
plugin:obsidian-textgenerator-plugin:2098 TypeError: Cannot read properties of undefined (reading 'isMap')
at IX (plugin:obsidian-textgenerator-plugin:1805:16563)
at I.request (plugin:obsidian-textgenerator-plugin:1958:70)
at async eval (plugin:obsidian-textgenerator-plugin:1962:422)
handelError @ plugin:obsidian-textgenerator-plugin:2098
plugin:obsidian-textgenerator-plugin:2098 TypeError: Cannot read properties of undefined (reading 'isMap')
at IX (plugin:obsidian-textgenerator-plugin:1805:16563)
at I.request (plugin:obsidian-textgenerator-plugin:1958:70)
at async eval (plugin:obsidian-textgenerator-plugin:1962:422)
handelError @ plugin:obsidian-textgenerator-plugin:2098
plugin:obsidian-textgenerator-plugin:1999 Object
plugin:obsidian-textgenerator-plugin:1997 calling stream generate
plugin:obsidian-textgenerator-plugin:1997 the request Object
plugin:obsidian-textgenerator-plugin:2098 TypeError: Cannot read properties of undefined (reading 'isMap')
at IX (plugin:obsidian-textgenerator-plugin:1805:16563)
at c.request (plugin:obsidian-textgenerator-plugin:1958:70)
at async eval (plugin:obsidian-textgenerator-plugin:1962:422)
handelError @ plugin:obsidian-textgenerator-plugin:2098
plugin:obsidian-textgenerator-plugin:2098 TypeError: Cannot read properties of undefined (reading 'isMap')
at IX (plugin:obsidian-textgenerator-plugin:1805:16563)
at c.request (plugin:obsidian-textgenerator-plugin:1958:70)
at async eval (plugin:obsidian-textgenerator-plugin:1962:422)
handelError @ plugin:obsidian-textgenerator-plugin:2098
plugin:obsidian-textgenerator-plugin:1999 Object
plugin:obsidian-textgenerator-plugin:1997 calling stream generate
plugin:obsidian-textgenerator-plugin:1997 the request Object
plugin:obsidian-textgenerator-plugin:2098 TypeError: Cannot read properties of undefined (reading 'isMap')
at IX (plugin:obsidian-textgenerator-plugin:1805:16563)
at c.request (plugin:obsidian-textgenerator-plugin:1958:70)
at async eval (plugin:obsidian-textgenerator-plugin:1962:422)
handelError @ plugin:obsidian-textgenerator-plugin:2098
plugin:obsidian-textgenerator-plugin:2098 TypeError: Cannot read properties of undefined (reading 'isMap')
at IX (plugin:obsidian-textgenerator-plugin:1805:16563)
at c.request (plugin:obsidian-textgenerator-plugin:1958:70)
at async eval (plugin:obsidian-textgenerator-plugin:1962:422)
handelError @ plugin:obsidian-textgenerator-plugin:2098
plugin:obsidian-textgenerator-plugin:1999 Object
plugin:obsidian-textgenerator-plugin:1997 calling stream generate
plugin:obsidian-textgenerator-plugin:1997 the request Object
plugin:obsidian-textgenerator-plugin:2098 TypeError: Cannot read properties of undefined (reading 'isMap')
at IX (plugin:obsidian-textgenerator-plugin:1805:16563)
at c.request (plugin:obsidian-textgenerator-plugin:1958:70)
at async eval (plugin:obsidian-textgenerator-plugin:1962:422)
handelError @ plugin:obsidian-textgenerator-plugin:2098
plugin:obsidian-textgenerator-plugin:2098 TypeError: Cannot read properties of undefined (reading 'isMap')
at IX (plugin:obsidian-textgenerator-plugin:1805:16563)
at c.request (plugin:obsidian-textgenerator-plugin:1958:70)
at async eval (plugin:obsidian-textgenerator-plugin:1962:422)
handelError @ plugin:obsidian-textgenerator-plugin:2098
plugin:obsidian-textgenerator-plugin:1999 {customContext: undefined, context: {…}}
plugin:obsidian-textgenerator-plugin:1997 calling stream generate
plugin:obsidian-textgenerator-plugin:1997 the request {request: Request}
plugin:obsidian-textgenerator-plugin:2098 TypeError: Cannot read properties of undefined (reading 'isMap')
at IX (plugin:obsidian-textgenerator-plugin:1805:16563)
at c.request (plugin:obsidian-textgenerator-plugin:1958:70)
at async eval (plugin:obsidian-textgenerator-plugin:1962:422)
handelError @ plugin:obsidian-textgenerator-plugin:2098
generateStreamInEditor @ plugin:obsidian-textgenerator-plugin:2002
await in generateStreamInEditor
generateInEditor @ plugin:obsidian-textgenerator-plugin:2002
eval @ plugin:obsidian-textgenerator-plugin:2093
(anonymous) @ app.js:1
e.handleEvent @ app.js:1
plugin:obsidian-textgenerator-plugin:2098 TypeError: Cannot read properties of undefined (reading 'isMap')
at IX (plugin:obsidian-textgenerator-plugin:1805:16563)
at c.request (plugin:obsidian-textgenerator-plugin:1958:70)
at async eval (plugin:obsidian-textgenerator-plugin:1962:422)
handelError @ plugin:obsidian-textgenerator-plugin:2098
eval @ plugin:obsidian-textgenerator-plugin:2093
await in eval
(anonymous) @ app.js:1
e.handleEvent @ app.js:1 |
I get the same error message, but for me occurs if I use a {{#script}}...{{/script}} block anywhere within a template and while on Android. It works fine on a PC. The code I was trying to run was simply an "await gen( android 10,obsidian 1.6.7, text generator 0.7.37 |
I'm assuming the |
The bug should be fixed. Thanks for reporting the bug and sorry for the late fix |
The error occurs when I make a request to https://openrouter.ai/api/v1/chat/completions with the API key on an Android mobile device. Everything is set up exactly the same on the computer, and it works. Initially, I just copied the plugin folder into the mobile Obsidian config and tried to run it, but this error appeared. Then I deleted the plugin and installed it from scratch, entering all the settings - the result is the same. According to openrouter.ai, I can see that the request is reaching the server, and tokens are being consumed. If I set a different provider, it works on the mobile device.
The text was updated successfully, but these errors were encountered: