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

it messes with import.meta.url #341

Open
jimmywarting opened this issue May 6, 2023 · 1 comment
Open

it messes with import.meta.url #341

jimmywarting opened this issue May 6, 2023 · 1 comment
Labels

Comments

@jimmywarting
Copy link

jimmywarting commented May 6, 2023

when i tried to load https://jspm.dev/await-sync in deno it failed with

error: Uncaught (in worker "") Module not found "https://jspm.dev/worker.js".

i guess it's b/c jspm tries to flatten out all files to the root

it then tries to load
https://jspm.dev//npm:await-sync@1.0.0

which then have code that looks like:

  // Create the worker thread
  const url = new URL('./worker.js', import.meta.url);
  const worker = new Worker(url, { type: 'module' });

but this file is located at https://jspm.dev/npm:await-sync@1.0.0 so therefore it tries to load the worker.js from https://jspm.dev/worker.js which is wrong.

so i then tested this out in jspm.io prod and it keeps the folder structure so it isn't flatten out at the root.
https://ga.jspm.io/npm:await-sync@1.0.0/mod.js

this looks promesing. it has /mod.js which is a good sign.
but then it tries to load https://ga.jspm.io/npm:await-sync@1.0.0/worker.js which (you guess'ed it) returns 404 not found 😕

i guess it's b/c it only saves files on the cdn that it can find via traversing import statements?


either way i can't use await-sync via jspm in any way possible.

@guybedford
Copy link
Member

We don't currently support the new URL('./path.js', import.meta.url) pattern in JSPM with import.meta.url replacements, but we should.

Thanks for posting the issue, I will try to get to a fix within the next week or so at most.

@guybedford guybedford added the bug label May 7, 2023
@guybedford guybedford transferred this issue from jspm/jspm-core Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants