为了利用Next.js,我将一个项目从Heroku迁移到Vercel。这不是我第一次使用Next,但我以前从未遇到过这样的bug。
昨晚我成功地构建了它,它运行得很好,但是在这段过程中,我得到了这样的错误消息:
HookWebpackError: Unexpected '/'. Escaping special characters with \ may help.
at makeWebpackError (/opt/homebrew/lib/node_modules/next/dist/compiled/webpack/bundle5.js:41630:9)
at /opt/homebrew/lib/node_modules/next/dist/compiled/webpack/bundle5.js:25321:12
at eval (eval at create (/opt/homebrew/lib/node_modules/next/dist/compiled/webpack/bundle5.js:140036:10), <anonymous>:48:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
-- inner error --
Error: Unexpected '/'. Escaping special characters with \ may help.
at /Users/bigsexy/Desktop/currentProjects/portfolio_on_next/static/css/1ec7d2389c57fd3d.css:425:1
at Root._error (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:95188)
at Root.error (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:141043)
at Parser.error (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:103534)
at Parser.unexpected (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:104020)
at Parser.combinator (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:102267)
at Parser.parse (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:109511)
at Parser.loop (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:108916)
at new Parser (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:95045)
at Processor._root (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:111925)
at Processor._runSync (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:112432)
caused by plugins in Compilation.hooks.processAssets
Error: Unexpected '/'. Escaping special characters with \ may help.
at /Users/bigsexy/Desktop/currentProjects/portfolio_on_next/static/css/1ec7d2389c57fd3d.css:425:1
at Root._error (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:95188)
at Root.error (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:141043)
at Parser.error (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:103534)
at Parser.unexpected (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:104020)
at Parser.combinator (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:102267)
at Parser.parse (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:109511)
at Parser.loop (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:108916)
at new Parser (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:95045)
at Processor._root (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:111925)
at Processor._runSync (/opt/homebrew/lib/node_modules/next/dist/compiled/cssnano-simple/index.js:195:112432)我翻阅了每一个文件,却找不到这是在说什么,所以我猜它来自npm包?是否有方法将生成文件从失败的构建中保存,以便我可以检查static/css/1ec...css文件?我尝试使用--debug标志运行构建,但它没有提供更多的信息。
我会张贴代码片段,但我甚至不知道在哪里寻找,所以这里的回购任何人有任何想法。
https://github.com/igloo1505/portfolio_on_next
提前感谢!
发布于 2022-02-05 06:10:19
https://stackoverflow.com/questions/70995411
复制相似问题