-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Worker: Disable relative import specifiers #5216
Comments
Hmmm... module resolution logic will always differ from a browser and a runtime. |
Good point, we can keep it enabled for Workers spawned from within Workers since we do have a clear new Worker(new URL("./worker.ts", import.meta.url), { type: "module" }); is going to be the common usage anyway. |
Can someone explain why this seems a good functionality as opposed to relative path? Is it because of the complexity to implement it or just opinion based? |
@aniketbiprojit It's about being analogous to the web. We don't have a |
A quick check on Chrome shows that relative import specifiers for Workers are resolved from
globalThis.location
. We don't have this concept at the moment so it should fail.(Currently our
Worker
resolves from the main module, which used to be ourglobalThis.location
.)The text was updated successfully, but these errors were encountered: