emscripten-core/emscripten
Auf GitHub ansehenFaulty assertion in node on .mjs files
Open
#17.465 geöffnet am 18. Juli 2022
JavaScriptgood first bughelp wanted
Repository-Metriken
- Stars
- (27.361 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 19T 10h) (147 gemergte PRs in 30 T)
Beschreibung
It turns out that node will disable the global require function on foo.mjs - that is just not defined there, unlike for foo.js. I guess mjs files are modules and require is not supposed to be used there. This ends up a problem for us since we have an assertion on it:
Removing that assertion is necessary to run an .mjs file in node with -sASSERTIONS.
We should probably just remove it?
This happens on binaryen CI which will manually builds an .mjs file by concatenating the emcc output with some extra code.