Dynamically importing a module loses "ownership"... (but not in the Solid playground) #2355
-
This is gonna be a weird one. I'm building an app that allows 3rd party code to be loaded as plugins. This code will be loaded dynamically, e.g. const script = `import {...} from 'solid-js'` // rest of code omitted for brevity
const blob = new Blob([script], { type: "text/javascript" });
const url = URL.createObjectURL(blob);
const module = await import(url); Here's it working in the Solid playground, as evidenced by Describing the code:
However, the plugin doesn't have an owner when used in a minimal Vite app with identical code as evidenced in this Stackblitz. The I've tried downgrading to the version of Solid used by the playground, dev and preview builds, and How can I get the plugin to have an owner like in the Playground? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ah derp. I needed
and to run it in |
Beta Was this translation helpful? Give feedback.
Ah derp. I needed
and to run it in
production
mode... which I wrote about a year ago. Ulgh.