You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
node main.js
file:///Users/surma/src/scratch/emscriptenes6/test.js:10
var a;a||(a=typeof Module !== 'undefined' ? Module : {});var f,g;a.ready=new Promise(function(b,d){f=b;g=d});var h={},l;for(l in a)a.hasOwnProperty(l)&&(h[l]=a[l]);var m="",n,p,q,r;m=__dirname+"/";n=function(b){q||(q=require("fs"));r||(r=require("path"));b=r.normalize(b);return q.readFileSync(b,null)};p=function(b){b=n(b);b.buffer||(b=new Uint8Array(b));b.buffer||t("Assertion failed: undefined");return b};1<process.argv.length&&process.argv[1].replace(/\\/g,"/");process.argv.slice(2);
^
ReferenceError: __dirname is not defined
at file:///Users/surma/src/scratch/emscriptenes6/test.js:10:182
at main (file:///Users/surma/src/scratch/emscriptenes6/main.js:4:9)
at file:///Users/surma/src/scratch/emscriptenes6/main.js:6:1
at ModuleJob.run (node:internal/modules/esm/module_job:175:25)
at async Loader.import (node:internal/modules/esm/loader:178:24)
at async Object.loadESM (node:internal/process/esm_loader:68:5)
The text was updated successfully, but these errors were encountered:
Glue code with
-s EXPORT_ES6
doesn’t load in Node as it relies on__dirname
, which doesn’t exist for modules.Repro
package.json
to set package to module modeCompile with:
Run in Node:
The text was updated successfully, but these errors were encountered: