Next.js Discord

Discord Forum

ERR_SSL_PROTOCOL_ERROR when testing locally

Answered
D Trombett posted this in #help-forum
Open in Discord
Avatar
Today I was working on my nextjs project and I wanted to test it on my mobile, as I normally do, so I opened up chrome on my phone and put the local ip address of the PC as always, but, to my surprise, it just loaded the first base html without loading any style, scripts or anything. So i tried doing the same on my PC and ran into the same problem. I tried inspecting the page and I found all of these net::ERR_SSL_PROTOCOL_ERROR.
Last time I used it was some weeks ago, probably, and I had no problem. I tried starting a server with npx serve in a folder with only HTML & JS files and it worked normally so the problem is present only when using next dev. If I open normally localhost:3000 it works but, of course, I cannot open it with other devices.
I've attached the screenshots of the network and console logs if it helps.
Do you have any idea how can I fix this annoying error?
Thanks!
Image
Image
Answered by D Trombett
I managed to solve it. Recently I made some changes to the content security policy header and it seems that chrome doesn't like them! Removing the header in development fixed the issue
View full answer

1 Reply

Avatar
I managed to solve it. Recently I made some changes to the content security policy header and it seems that chrome doesn't like them! Removing the header in development fixed the issue
Answer