작성
·
237
0
root@ip-172-31-39-250:/home/ubuntu/Nodebird/front# npm run build
> react-nodebird-front@1.0.0 build /home/ubuntu/Nodebird/front
> cross-env ANALYZE=true next build
Creating an optimized production build ...
Webpack Bundle Analyzer saved report to /home/ubuntu/Nodebird/front/.next/analyze/server.html
Failed to compile.
./node_modules/@ant-design/icons/lib/dist.js 5:6
Module parse failed: 'import' and 'export' may only appear at the top level (5:6)
You may need an appropriate loader to handle this file type.
| // 加载script标签会阻塞js执行,antd部分组件(如表格)无法在一轮循环内完成完整的渲染,故延时
| setTimeout(function(){
> import(/* webpackChunkName: "antd-icons" */'!!./dist.js').then(function(allIcons) {
| AutoReloadIcon.load(allIcons);
| });
> Build error occurred
Error: > Build failed because of webpack errors
at Object.build [as default] (/home/ubuntu/Nodebird/front/node_modules/next/dist/build/index.js:192:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-nodebird-front@1.0.0 build: `cross-env ANALYZE=true next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-nodebird-front@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-06-18T10_35_44_822Z-debug.log
root@ip-172-31-39-250:/home/ubuntu/Nodebird/front#
---------------------------------------------------------------
아래 질문이랑 참고해서 웹팩버전을 바꿨는데.. 그래도 같은 오류가 발생합니다.