next.js 在Vercel上将应用程序部署到生产时出错

x4shl7ld  于 2023-03-18  发布在  其他
关注(0)|答案(1)|浏览(169)

问题描述

我正在尝试将应用程序部署到Vercel,但仍然遇到此错误。我已根据在线找到的建议花费大量时间尝试解决此问题,但无济于事。我不知道从何处开始调试,因为这些文件/行与我的文件/行都不一样。请您查看并帮助我解决此问题:
我所做的:
1.已安装npm i -保存设备eslint配置下一步
1.设置我的eslint.json文件以反映此更改

{
  "extends": ["next/babel", "next/core-web-vitals"],
  "plugins": ["prettier"]
}

下一版本:"next": "12.2.5",
我在Vercel中遇到的错误:

info  - Linting and checking validity of types...
error - ESLint: Failed to load config "next/babel" to extend from. Referenced from: /vercel/path0/.eslintrc.json
info  - Creating an optimized production build...
Failed to compile.
HookWebpackError: Expected a pseudo-class or pseudo-element.
    at makeWebpackError (/vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:49719:9)
    at /vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:33203:12
    at eval (eval at create (/vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:23493:10), <anonymous>:34:1)
-- inner error --
Error: Expected a pseudo-class or pseudo-element.
    at /vercel/path0/static/css/3ca6c98c02d68801.css:2617:3
    at Root._error (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:78465)
    at Root.error (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:124360)
    at Parser.error (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:86811)
    at Parser.pseudo (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:89313)
    at Parser.parse (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:92668)
    at Parser.loop (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:92233)
    at new Parser (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:78322)
    at Processor._root (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:95242)
    at Processor._runSync (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:95749)
caused by plugins in Compilation.hooks.processAssets
Error: Expected a pseudo-class or pseudo-element.
    at /vercel/path0/static/css/3ca6c98c02d68801.css:2617:3
    at Root._error (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:78465)
    at Root.error (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:124360)
    at Parser.error (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:86811)
    at Parser.expected (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:93145)
    at Parser.pseudo (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:89313)
    at Parser.parse (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:92668)
    at Parser.loop (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:92233)
    at new Parser (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:78322)
    at Processor._root (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:95242)
    at Processor._runSync (/vercel/path0/node_modules/next/dist/compiled/cssnano-simple/index.js:190:95749)
> Build failed because of webpack errors
Error: Command "npm run build" exited with 1
BUILD_FAILED: Command "npm run build" exited with 1
kknvjkwl

kknvjkwl1#

我最好的猜测是任何一个css文件的语法都是错误的。这也可能对www.example.com有帮助https://github.com/postcss/postcss/issues/1246#issuecomment-466853866

相关问题