when I print document to html, console reports a err as follows:
ERR Cannot find module '@thomaskoppelaar/markdown-it-wikilinks'
Require stack:
- c:\Users\orangee\.vscode\extensions\kortina.vscode-markdown-notes-0.0.20\out\MarkdownRenderingPlugin.js
- c:\Users\orangee\.vscode\extensions\kortina.vscode-markdown-notes-0.0.20\out\extension.js
- c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js
- c:\Program Files\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Program Files\Microsoft VS Code\resources\app\out\bootstrap-fork.js:
and then, I can't find html in my current markdown file path
Print document to HTML successfully!
Markdown All in One: Print current document to HTMLHelp -> Toggle Developer Toolserr is shown in console
ERR Cannot find module '@thomaskoppelaar/markdown-it-wikilinks'
Require stack:
- c:\Users\orangee\.vscode\extensions\kortina.vscode-markdown-notes-0.0.20\out\MarkdownRenderingPlugin.js
- c:\Users\orangee\.vscode\extensions\kortina.vscode-markdown-notes-0.0.20\out\extension.js
- c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js
- c:\Program Files\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Program Files\Microsoft VS Code\resources\app\out\bootstrap-fork.js:
Thanks for the feedback.
The _Markdown Notes_ extensions uses a non-standard(?) way to extendMarkdownIt
Not sure whether it matters 🤔
cc @1354092549 (in case you have some insights into this issue).
Does the Markdown Notes extensions work well when previewing?
It seems the error is reported by VSCode Extension Loader.
Is there more detailed stacktrace?
Just tried on my PC and it seems it is an issue of Markdown Notes (on its activation). We can still see the error message if we do nothing but open a Markdown file.
Does the Markdown Notes extensions work well when previewing?
I haven't used this extension before but from what I can see, it doesn't work in the VSCode's preview tab. (@orangee-wi)
Generally speaking, that extension is supposed to be shipped with markdown-it-wikilinks. But it doesn't:
https://github.com/kortina/vscode-markdown-notes/issues/101
VS Code ignores broken extensions:
https://github.com/microsoft/vscode/blob/2b7760fa1fac6902b6114e79a0873dfd6ba7ad6c/extensions/markdown-language-features/src/markdownEngine.ts#L79-L85
Maybe we can do similar things here
https://github.com/yzhang-gh/vscode-markdown/blob/3037848b96033584b19abb599f8a5f54332f30fe/src/markdownEngine.ts#L91-L96
It's okey to just add a try-catch block. And log may be needed.
What about:
// Skip the third-party Markdown extension, if it is broken or crashes.
try {
md = await contribute.extendMarkdownIt(md);
} catch (err) {
console.error(`Skipped Markdown extension: ${contribute.extensionId}\nBecause:\n${err}`);
}