Cannot read properties of undefined (reading 'path')
TypeError: Cannot read properties of undefined (reading 'path')
at t.getFileCache (app://obsidian.md/app.js:1:1099881)
at On (plugin:obsidian42-strange-new-worlds:1:48486)
at eval (plugin:obsidian42-strange-new-worlds:7:2849)
at Function. (app://obsidian.md/app.js:1:1214243)
at app://obsidian.md/app.js:1:235201
at Object.next (app://obsidian.md/app.js:1:235306)
at app://obsidian.md/app.js:1:234243
at new Promise ()
at m (app://obsidian.md/app.js:1:233988)
at Function.t.renderMarkdown (app://obsidian.md/app.js:1:1213855)
Excalidraw fails on the Obsidian MarkdownRenderer here, it is rendering this file:
Debugging it seems the render actually completes (I can see the result on screen) but then something happens in the background, I guess you have a postprocessor that does something with links that somehow crashes.
I turned on logging app.plugins.plugins["obsidian42-strange-new-worlds"].snwAPI.enableDebugging.PreviewRendering = true and got the following log:
error.log
Seems here you do not check if currentFile is undefined:
https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/867
Cannot read properties of undefined (reading 'path')
TypeError: Cannot read properties of undefined (reading 'path') at t.getFileCache (app://obsidian.md/app.js:1:1099881) at On (plugin:obsidian42-strange-new-worlds:1:48486) at eval (plugin:obsidian42-strange-new-worlds:7:2849) at Function. (app://obsidian.md/app.js:1:1214243)
at app://obsidian.md/app.js:1:235201
at Object.next (app://obsidian.md/app.js:1:235306)
at app://obsidian.md/app.js:1:234243
at new Promise ()
at m (app://obsidian.md/app.js:1:233988)
at Function.t.renderMarkdown (app://obsidian.md/app.js:1:1213855)
Excalidraw fails on the Obsidian MarkdownRenderer here, it is rendering this file:
https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/fdb7e97b1182983c594cd498e33b239aa22cce40/src/dialogs/ScriptInstallPrompt.ts#L30-L35
Debugging it seems the render actually completes (I can see the result on screen) but then something happens in the background, I guess you have a postprocessor that does something with links that somehow crashes.
I turned on logging
app.plugins.plugins["obsidian42-strange-new-worlds"].snwAPI.enableDebugging.PreviewRendering = true
and got the following log: error.logSeems here you do not check if currentFile is undefined:
https://github.com/TfTHacker/obsidian42-strange-new-worlds/blob/44fb0d9f9cfd8ca01369e99ac137f32d2b9679aa/src/view-extensions/references-preview.ts#L35-L37