将NextJs部署到Vercel - - error ESLint:无法加载插件“compat”mpat“需要堆栈:-/vercel/path0/__placeholder__.js

nbewdwxp  于 2023-08-04  发布在  其他
关注(0)|答案(1)|浏览(86)

我已经部署了一个NextJs到Vercel。有些页面工作正常,但有些则不然。我在日志中得到以下错误

- error ESLint: Failed to load plugin 'compat' declared in '.eslintrc.json': Cannot find module 'eslint-plugin-compat' Require stack: - /vercel/path0/__placeholder__.js`

字符串
它在我的本地主机上运行良好
这是我的package.json

"dependencies": {   
  "@types/node": "20.4.4",
  "@types/react": "18.2.15", 
  "@types/react-dom": "18.2.7", 
  "animate.css": "^4.1.1",   
  "aos": "^2.3.4",     
  "bootstrap": "^5.3.0",    
  "chartist": "^1.3.0", 
  "eslint": "8.45.0",
  "eslint-config-next": "13.4.12",   
  "eslint-plugin-compat": "^4.1.4",  
  "metismenu": "^3.0.7",
  "next": "13.4.12",   
  "owl.carousel": "^2.3.4", 
  "perfect-scrollbar": "^1.5.5",
  "react": "18.2.0",  
  "react-dom": "18.2.0", 
  "sass": "^1.64.1",   
  "sharp": "^0.32.4",  
  "typescript": "5.1.6"
}


我删除了ESlint的内容逐渐开始只删除插件我还删除了这个// eslint-disable-line compat/compat从font-awsome冲突检测. js

deyfvvtc

deyfvvtc1#

您的@types/node依赖项是20.4.4。Vercel仅支持最高节点版本18。最有可能的情况是,您正在使用节点18进行部署。因此,将@types/nodes版本减少到18

相关问题