personalizedrefrigerator / joplin-plugin-revealjs-slides

Present Joplin notes as slide decks.
MIT License
11 stars 1 forks source link

Error in console #4

Closed laurent22 closed 4 months ago

laurent22 commented 6 months ago

Not sure if it affects functionalities but I'm getting the below error in the console, while running in dev mode:

Uncaught ReferenceError: exports is not defined
    at getRenderedMarkdown.js:1:941

which points to this line:

image
personalizedrefrigerator commented 6 months ago

Thank you for reporting this — the exports.default is generated by Webpack from this file.

Summary of the problem

I suspect that this is because Webpack is trying to generate CommonJS modules for scripts referenced in extraScripts: https://github.com/personalizedrefrigerator/joplin-plugin-revealjs-slides/blob/744832080b4be46388d346cf38ffe2d143f333f1/webpack.config.js#L265-L267

This script is then loaded as a Markdown-it asset, rather than a plugin: https://github.com/personalizedrefrigerator/joplin-plugin-revealjs-slides/blob/744832080b4be46388d346cf38ffe2d143f333f1/src/contentScripts/markdownIt.ts#L5

The Markdown-it and CodeMirror content scripts probably do not cause this error because:

I've also noticed this with other plugins that show dialogs with content scripts that have been processed by Webpack (e.g. the Freehand Drawing plugin).

Possible solutions

personalizedrefrigerator commented 4 months ago

Fixed upstream.