-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
Lib throws error when imported inside a service worker #449
Comments
Analyzing the code I can guess that the expression |
Filesaver don't work in service workers. Why do include it there? |
It's mainly because it breaks the SW registration if a file used by the SW imports the lib, even if it's not being used inside the SW. |
Hi! Currently our team is working on a big react-redux based project. We have the same error and it totally breaks our worker based calculations. Note, that we don't import 'file-saver' directly into worker script, it happens through the chain of other imports (about 15). For now I just fixed it by moving one util to different module to break that chain. But it took some time to find out what happens. So it'd be great if such a scenario was taken into account when releasing the next version. Thanks in advance. |
Currently on the project that I'm working on, there's a build process for the service worker used in the application, and one of the files used by the service worker is importing the lib, although the lib is not used inside the service worker, it throws an error when executing the service worker script, which is:
TypeError: Cannot read property 'createElementNS' of undefined
The text was updated successfully, but these errors were encountered: