报错
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "console": require.resolve("console-browserify") }'
- install 'console-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "console": false }`
一开始以为是webpack5报错问题,一直在找webpack.config.js文件在哪
结果???阅读代码发现多了个‘console’引用
//引入组件
import MyHeader from './components/MyHeader'
import MyList from './components/MyList'
import MyFooter from './components/MyFooter'
import { timeLog } from 'console'
引用了一个无用的东西报错
总结:观察error,注意代码规范
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)