No Service Worker support
See original GitHub issueI’m loading this library in a service worker and it fails to run because it attempts to use document
even if it’s getCssSelector isn’t called.
I think the library should not expect these globals before it’s called.
The same happens if I try to run build/index.js
in node (just as a test), except it complains about self
Can changes be made so the module doesn’t break the rest of the app by just “existing”?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Service worker is not supported in chrome (69.0.3497.81)
it's working fine. Chrome requires service workers to be served over https, but allows an exception for localhost for development. Share.
Read more >Service Workers | Can I use... Support tables for ... - CanIUse
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >Using Service Workers - Web APIs | MDN
This article provides information on getting started with service workers, including basic architecture, registering a service worker, ...
Read more >Service workers - web.dev
Not all browsers support service workers. Even when present your service worker won't be available on first load or while it's waiting to...
Read more >I am getting "Service workers are not supported" : r/firefox
Everything works perfectly in Chrome(ium), but not in Firefox. No matter what I do, I get "Service workers are not supported.".
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the bug report @fregante. I have created a pre-patch version
v3.4.5-0
, that should potentially solve the problem. It removes all references to thedocument
object: https://www.npmjs.com/package/css-selector-generator/v/3.4.5-0Can you please check if it works for you, before I create official patch build of the library?
Hey @fregante, can you please try
v3.4.6-0
?I have reorganised the project a bit and added an ESM version. The UMD code generated by Webpack contains references to
self
. I don’t want to convert the original UMD build, because that would be a major breaking change.You should be able to use the ESM version like this: