1,warning.js:33 Warning: It looks like you're using a minified copy of the development build of React. When deploying React apps to production, make sure to use the production build which skips development warnings and is faster. See fb.me/react-minif… for more details.
warning.js:14 You are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (github.com/zertosh/loo…) for browserify or DefinePlugin for webpack (stackoverflow.com/questions/3…) to ensure you have the correct code for your production build.
解决方法:
在plugins里面添加:
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
})
复制代码
2,打包的时候出现 Refused to apply style from 'http://0.0.0.0:2003/loader.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
解决方法:
有可能在package.json里面build里面执行的文件不对,build里面引入了webpack.production.config.js,而不是webpack.config.js,开发环境和生产环境的问题,具体要看自己的环境再做决定。
3,React-Hot-Loaded is not supported in this environment.
解决方法:
production环境js压缩去掉。
// JS压缩
// new webpack.optimize.UglifyJsPlugin({
// compress: {
// warnings: false,
// } }
// )
复制代码
4,warning.js:14 You are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (github.com/zertosh/loo…) for browserify or DefinePlugin for webpack (stackoverflow.com/questions/3…) to ensure you have the correct code for your production build.
解决方法:
这是Nodejs开发环境和生产环境问题 , webpack.config.js加上
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
})
复制代码
5,运行太慢 ,运行到了78%就出现additional chunk assets不动了 .
解决方法:
const BPlugin = require('babili-webpack-plugin’);
babili-webpack-plugin之类的插件去掉。
6,Uncaught RangeError: Maximum call stack size exceeded .
解决方法:
在package.json里的script里使用了--hot和在webpack.config.js里调用了HotModuleReplacementPlugin,最后把webpack.config.js里的HotModuleReplacementPlugin去掉就好了,用了package.json —hot之后就不需要用react-hot-loader了,不然会报react-hot-loader enabled的错误。