简体   繁体   English

如何使用react webapp修复白屏?

[英]How to fix a white screen with a react webapp?

I get a white screen on my react webapp (testing it in local), it worked perfectly yesterday and today when I tried it I got a white screen.我的 react webapp 出现白屏(在本地测试),昨天和今天都运行良好,当我尝试时,我得到了一个白屏。

I tried to look in the react developer tools but I don't see anything.我试图查看 React 开发人员工具,但什么也没看到。 I use in this web app React router and firebase.我在这个 Web 应用程序中使用 React 路由器和 Firebase。 Below is my package.json下面是我的 package.json

 {
      "name": "numbr",
      "version": "0.1.0",
      "private": true,
      "dependencies": {
        "@material-ui/core": "^4.3.1",
        "express": "^4.17.1",
        "firebase": "^6.3.4",
        "mysql": "^2.17.1",
        "node-sass": "^4.12.0",
        "nodemon": "^1.19.1",
        "react": "^16.8.6",
        "react-dom": "^16.8.6",
        "react-native-indicators": "^0.13.0",
        "react-router-dom": "^5.0.1",
        "react-scripts": "3.0.1",
        "recompose": "^0.30.0"
      },
      "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test",
        "eject": "react-scripts eject"
      },
      "eslintConfig": {
         "extends": "react-app"
      },
      "browserslist": {
        "production": [
          ">0.2%",
          "not dead",
          "not op_mini all"
        ],
        "development": [
          "last 1 chrome version",
          "last 1 firefox version",
          "last 1 safari version"
        ]
      }
    }

Thanks for your help in advance !提前感谢您的帮助!

2 things i can think of based on my own experience:根据我自己的经验,我能想到的2件事:

  1. clear all your cache, and restart.清除所有缓存,然后重新启动。
  2. Your file path to some things in your code is too long (especially in node_modules).代码中某些内容的文件路径太长(尤其是在 node_modules 中)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM