Closed saferust closed 10 months ago
There's not a particular reason -- it should be an IIFE target anyway with a .js
extension. I will merge #41 and make a release soon that should fix this for you.
Just released v0.3.4. Please update and close this issue if it fixed your problem.
It is working fine. Thanks!
I've encountered an issue with the
.mjs
file type while using mdbook quiz. When I open a page containing the quiz and test it through a server I get the following errors in different browsers:Firefox:
Microsoft Edge:
To resolve this issue the server must serve the
.mjs
file appropriately. However, when you don't have control over the server or are publishing files for public use, this can lead to problems (as I am here). Some tools may also not support the.mjs
extension.A workaround to make the
quiz-embed.mjs
module work is to append.js
to the end of.mjs
files, likequiz-embed.mjs.js
. This is accepted but it requires manual replacement of all artifacts in the generated code.Is there a reason for using the
.mjs
file extension?If it was for module clarity, preferred over
.js
, one could use.mjs
during development and convert to.js
during the build step. However, ensure that changing to a.js
file does not introduce additional issues. Currently this workaround is working for me without any issues.