简体   繁体   中英

Safari refresh loop with webpack-dev-server in https mode

I encountered a strange issue when I was testing a JS module on Safari Version 9.0.1 (11601.2.7.2)

So I am using webpack-dev-server with standard HMR configuration (but with https: true ) and the browser keeps refreshing even if I don't make updates to my source file. In fact it is stuck in a refresh loop.

When I open the inspector console I see this error briefly before reload:

WebSocket network error: OSStatus Error -9807: Invalid certificate chain

and then just before refresh

[WDS] Disconnected!
[WDS] App updated. Reloading...

Probably has something to do with the self-signed certificate verification failing. The server's running on https://localhost:1111 and I have visited the page in another tab to accept the certificates.

Has anyone encountered this before?

pass the inline: false parameter to your webpack devServer config, something like:

devServer: {
    hot: false,
    contentBase: './dist',
    https: true,
    port: 8000,
    inline: false,
},

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM