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

ESM issue on Firefox #283

Closed
khanhicetea opened this issue Nov 23, 2024 · 3 comments
Closed

ESM issue on Firefox #283

khanhicetea opened this issue Nov 23, 2024 · 3 comments

Comments

@khanhicetea
Copy link

Thanks for the lib,

I check the source then see register service worker type is classic ( So we can't use ESM modules ? )
I changed the register service worker type to module it work in Chromium browsers but not Firefox (because FF doesn't support ESM in SW)

Thanks

@ShafSpecs ShafSpecs added the question Further information is requested label Dec 5, 2024
@ShafSpecs
Copy link
Member

That's because Firefox doesnt support it yet, see: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker#browser_compatibility

@ShafSpecs ShafSpecs removed the question Further information is requested label Dec 5, 2024
@ShafSpecs
Copy link
Member

You can't use import statements in the service worker currently, if you look at your built service worker, you will see that the whole thing is built into one file. Without any imports or require() statements

@khanhicetea
Copy link
Author

Thanks for clarifying.

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

2 participants