简体   繁体   English

将 Chrome React Developer Tools 与 create-react-app 一起使用时出错

[英]Error using Chrome React Developer Tools with create-react-app

After creating a new create-react-app project I've run into a bit of a big problem when I run npm start inside the project.创建一个新的 create-react-app 项目后,当我在项目中运行 npm start 时遇到了一个大问题。 Chrome React Developer tools does not show all files in src folder. Chrome React Developer 工具不会显示 src 文件夹中的所有文件。 Instead it shows only folder ./src Chrome React Developer Tools相反,它只显示文件夹 ./src Chrome React Developer Tools

I am using nodejs 6.10.1 , create-react-app 1.3.0.我正在使用 nodejs 6.10.1,create-react-app 1.3.0。

package.json:包.json:

     {
      "name": "test",
      "version": "0.1.0",
      "private": true,
      "dependencies": {
        "axios": "^0.16.1",
        "bootstrap": "^3.3.7",
        "prop-types": "^15.5.9",
        "react": "^15.5.4",
        "react-bootstrap": "^0.30.10",
        "react-bootstrap-table": "^3.2.1",
        "react-dom": "^15.5.4",
        "react-redux": "^5.0.4",
        "react-router": "^3.0.0",
        "recharts": "^0.22.3",
        "redux": "^3.6.0",
        "redux-logger": "^3.0.1",
        "redux-promise-middleware": "^4.2.0",
        "redux-thunk": "^2.2.0"
      },
      "devDependencies": {
        "react-scripts": "0.9.5"
      },
      "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test --env=jsdom",
        "eject": "react-scripts eject"
      }
    }

Any advice how to fix it?任何建议如何解决它? I checked documentation but didn't find any solution.我检查了文档,但没有找到任何解决方案。

You can still debug the code using VScode Chrome extension, however its not my favorite way of debugging a frontend application.您仍然可以使用 VScode Chrome 扩展程序调试代码,但这不是我最喜欢的前端应用程序调试方式。

Use eject command to enable debugging.使用eject命令开启调试。 After you npm run eject , it reveals more configurations for you to edit, one of those is source-map type (under a webpack configuration).npm run eject ,它会显示更多配置供您编辑,其中之一是 source-map 类型(在 webpack 配置下)。 Once you eject, the source-map type changes thus allowing you to debug on chrome-dev-tools.弹出后,源映射类型会发生变化,从而允许您在 chrome-dev-tools 上进行调试。

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

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