Unhandled Rejection (SecurityError): The operation is insecure. On a fresh create-react-app project

后端 未结 5 2387
孤街浪徒
孤街浪徒 2021-02-19 15:26

I created a new project with create-react-app then ran npm start then this showed up. https://imgur.com/a/3By9NCr

Using FF 69.0.3

5条回答
  •  半阙折子戏
    2021-02-19 15:31

    A lot of answers here do actually solve the issue but the simplest way I have found is to add npm package serve to your dependencies.

    yarn add serve or npm i serve

    and then replace your start script with the following:

    "scripts": {
        "start": "serve -s build",
    }
    

    This is actually straight out of the create-react-app docs

提交回复
热议问题