invalid url string when attempting js module import
Currently trying to import from a file...
I get this error when I try to hit my worker
17 Replies
The file path should be correct
I guess this is also part of the error
Looks like something inside either
extractor
or index.js
is trying to parse an invalid URL string?maybe it's this?
Maybe? The structure above looks like some kind of OtherLang-to-WASM+Glue Code compiler, so might want to take it up there if there is an issue
it is... it just works when i use it outside of cloudflare... wondering if cloudflare doesn't support
import.meta
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.metaimport.meta - JavaScript | MDN
The import.meta meta-property exposes context-specific metadata to a JavaScript module. It contains information about the module, such as the module's URL.
I'm not sure, maybe try
console.log
ing it to see?yeah... gave it a shot but it I think it chokes first
Looks like that is a no
Think I figured it out, and I need to import my wasm directly... currently hitting this though
import one from "./extractor.core.wasm"
Is this being tested with Wrangler?
yes
I can't reproduce it personally, with
import module from "./square.wasm"
and wrangler dev
and then you pass
module
to WebAssembly.instantiate
?That or instance, both should work.
Workers doesn't support WASM from buffers, only modules, so they do the same thing.
Passing a buffer to instantiate in Workers will result in an exception.
fun, this one is still not fixed, half a year later
GitHub
Initial implementation of new jsg module registry by jasnell · Pull...
RM-17318
First step of the new module registry implementation (the jsg only bits). Expect several more follow up PRs.
This PR provides the initial core of the new module registry implementation. It...