即使我正在使用开发环境进行构建,我仍然遇到以下错误。下面是我的 package.json 文件。
Error: "for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
Package.json 文件:
"scripts": {
"compile": "webpack",
"start": "node server.js",
"dev": "webpack --mode development",
"build": "webpack --mode production",
"test": "echo \"Error: no test specified\" && exit 1"
},
我先执行 npm run build,然后执行 npm run start。我仍然遇到相同的缩小错误,我尝试删除bundle.js或./dist文件夹并在开发环境中完成构建,但我仍然面临同样的问题。
任何人都可以帮助我,如何避免这个缩小版本并在本地轻松调试文件?
最佳答案
删除 render
/return
方法中的任何注释
I used this regex in VSCode to find the troublesome comments: (\s*\n?\s*//
更多帮助here
关于reactjs - 缩小的 React 错误 #152 - 如何解决这个问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50497026/