Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 454
nardeas Avatar asked Nov 02 '16 09:11

nardeas


1 Answers

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

devServer: {
    hot: false,
    contentBase: './dist',
    https: true,
    port: 8000,
    inline: false,
},
like image 133
Peter Jensen Avatar answered Nov 07 '22 00:11

Peter Jensen