Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import scripts starting with "@" in the name from worker #16

Open
fnky opened this issue Jul 8, 2021 · 0 comments
Open

Cannot import scripts starting with "@" in the name from worker #16

fnky opened this issue Jul 8, 2021 · 0 comments

Comments

@fnky
Copy link

fnky commented Jul 8, 2021

I'm trying to import @radix-ui/colors from a worker script:

let w = createWorker(async w => {
  let colors = await w.import("@radix-ui/colors");
  w.send(JSON.stringify(colors));
});
print(await w.recv());

But it throws the following error:

Error: Failed to execute 'importScripts' on 'WorkerGlobalScope':
  The script at 'https://unpkg.com/@radix-ui/colors' failed to load.

This also happens with any URL starting with an at-symbol in a path:

https://cdn.skypack.dev/@radix-ui/colors
https://unpkg.com/@radix-ui/[email protected]/index.js

If I import a module without an at-symbol, it works correctly:

let w = createWorker(async w => {
  let colors = await w.import("culori");
  w.send(JSON.stringify(colors));
});
print(await w.recv());
@fnky fnky changed the title Cannot import scripts with "@" in the name from worker Cannot import scripts starting with "@" in the name from worker Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant