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

后端 未结 8 1553
南方客
南方客 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:05

    Simple to solve the issue by three steps

    1. set "react-scripts": "3.4.0" at package.json
    2. run [npm install]
    3. deploy to your host again, here I use an Azure NodeJS App Services https://fila.azurewebsites.net/Location and http://fila.azurewebsites.net/Location

    Yes, react-script version 3.2.0 is also ok but react-scripts 3.3.0 only run with http

    Good luck Thomas

提交回复
热议问题