How to fix the white screen after build with create-react-app?

前端 未结 5 1618
心在旅途
心在旅途 2021-01-12 14:05

I used react-router-dom and I build my react-app. When I deploy it on the server, I get a blank page and the console is empty.

My App.js is :



        
5条回答
  •  深忆病人
    2021-01-12 14:42

    I ran into the same problem and solved it!

    If anyone has still this issue, follow the following steps.

    1 - You need to update your browser. Refer to this, https://create-react-app.dev/docs/supported-browsers-features/#configuring-supported-browsers

    2- You need to add "react-router-dom": dependency to your package.json file using npm i react-router-dom

    3- Add "homepage": ".", to your package.json file

    Hope this helps.

提交回复
热议问题