Skip to content

it messes with import.meta.url #341

@jimmywarting

Description

@jimmywarting

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions