justjake / quickjs-emscripten

Safely execute untrusted Javascript in your Javascript, and execute synchronous code that uses async functions
https://www.npmjs.com/package/quickjs-emscripten
Other
1.18k stars 94 forks source link

Getting javascript modules error on latest release #183

Open mehmetron opened 1 week ago

mehmetron commented 1 week ago

First off, thanks for making this library publicly available! It's awesome!

The full error is:

Uncaught SyntaxError: Cannot use 'import.meta' outside a module at eval () at z (sandbox.275a9407e.js:1:94080) at K.evaluate (sandbox.275a9407e.js:1:106841) at ve. (sandbox.275a9407e.js:1:115700) at Generator.next () at i (sandbox.275a9407e.js:1:112149)

Sandbox where error takes place: https://codesandbox.io/p/sandbox/quickjs-emscription-forked-z48jf6

Sandbox with old version that works: https://codesandbox.io/p/sandbox/quickjs-emscription-pgf0f

Are you guys also getting this error? Didn't seem like it was related to my main javascript code but, instead, related to the wasm runtime

mehmetron commented 1 week ago

Version 0.24.0 seems to be the last version before things start breaking in this sandbox:

https://codesandbox.io/p/sandbox/quickjs-emscription-forked-94k495