quickjs-emscripten icon indicating copy to clipboard operation
quickjs-emscripten copied to clipboard

Errors occurred when using the quickjs-emscripten package normally as follows code

Open fujingzhi opened this issue 5 months ago • 1 comments
trafficstars

Testing code as below: Image

,and the error tips:

Image

What possible reasons could cause this?

fujingzhi avatar Jun 06 '25 02:06 fujingzhi

Your bundler transpiled import.meta.url to import_meta.url, and this property isn't a valid URL. This property is supposed to give a URL (like file:// or http://) to the current file so that we can locate the WASM file adjacent to the Javascript file. The bundler should "do the right thing" when it injects import_meta but it may not actually define import_meta.url.

I recommend setting a breakpoint at that expression, and then logging import_meta.url. If this is undefined, you need to configure your bundler to fill it. If it's an invalid URL, you'll need to debug why in your bundler configuration

justjake avatar Jun 22 '25 22:06 justjake