React app error: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS

后端 未结 8 1606
南方客
南方客 2020-12-01 10:29

I am deploying a React app but am getting a strange error when I visit the page over https.

When I visit the page over https I receive the following error:

S

8条回答
  •  余生分开走
    2020-12-01 11:04

    Here's a simpler solution. Downgrade your react-scripts to 3.2.0 in your package.json (mine was at 3.3.0).

    You may need to delete your package-lock.json and node_modules (rm -rf package-lock.json node_modules), then do a npm i. Commit both your new package.json and package-lock.json to the repo.

提交回复
热议问题