-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Pwa- Service worker not work #4540
Comments
Please create reproducible test repo, hard to say what is wrong |
Are you using multiple entries for app and service worker? If yes, try this solution. I'm still having trouble with hot reloading though. |
@thebat93 Do you use plugin for service worker code generation or it is self-created code? |
@alexander-akait it is a self created code. For debug purposes it has only
|
Here's my message in another issue |
@alexander-akait here is a minimal test repo with the issue: https://github.com/thebat93/sw-webpack-hmr |
Confirm what you say @thebat93 . Your solution to bypass the issue on pack-dev-server work :
Thanks |
Bug report
The service worker not work with webpack DevServer also when dev-server is configure in write memory like specify in :
(https://webpack.js.org/configuration/dev-server/) writes in-memory
Actual Behavior
The service worker is register and activated but event are never trigger. no error
Expected Behavior
Event of service worker should be trigger
How Do We Reproduce?
self.addEventListener('install', event => { console.log('Hello'); });
with other web server you will have in the console :
but with dev-server only
Please paste the results of
npx webpack-cli info
here, and mention other relevant information"webpack": "5.74.0",
"webpack-dev-server": "4.10.0"
const serverConfig = { client: { overlay: false, logging: 'error', }, devMiddleware: { writeToDisk: true, }, open: false, https: false, host: '127.0.0.1', port: 5800, hot: true, liveReload: false, static: { directory: path.join(__dirname, 'dist/'), } };
The text was updated successfully, but these errors were encountered: