【发布时间】:2020-12-24 13:27:57
【问题描述】:
the screen shot of project$ npm run build
> learn-starter@0.1.0 build
> next build
(node:31220) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at C:\Users\murtu\OneDrive\Desktop\myProject\nextjs_practice\new_practice\nextjs-blog\node_modules\postcss\package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
info - Creating an optimized production build
Failed to compile.
chunk 30cd56ec8b4292fd1d19f6bfd4b67b1689d06305_CSS
static/css/851b1bf4ba9315e79ff2.css
Cannot read property 'pop' of undefined
> Build error occurred
Error: > Build failed because of webpack errors
at C:\Users\murtu\OneDrive\Desktop\myProject\nextjs_practice\new_practice\nextjs-blog\node_modules\next\dist\build\index.js:15:918
at async C:\Users\murtu\OneDrive\Desktop\myProject\nextjs_practice\new_practice\nextjs-blog\node_modules\next\dist\build\tracer.js:1:525
npm ERR! code 1
npm ERR! path C:\Users\murtu\OneDrive\Desktop\myProject\nextjs_practice\new_practice\nextjs-blog
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c next build
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\murtu\AppData\Local\npm-cache\_logs\2020-12-24T13_03_26_358Z-debug.log
我正面临这个问题,因为我尝试了许多来自互联网的解决方案,例如创建 next.config.js
当我使用 npm run dev 时,该项目运行良好
谁能帮我这里有什么问题
正如我所说,该项目在npm run dev 上完美运行。
我真的厌倦了这个问题,请在这里帮助我。
【问题讨论】:
-
你成功了吗?面临同样的问题。不清楚可能是什么原因。