当我将我的nextjs应用上传到vercel时,我收到了这个错误,请帮我解决。
发布于 2022-09-08 06:45:01
这是一个ESLint错误,您可以禁用这个特定的检查。
查看我的eslint配置,我禁用了这个规则。
//.eslintrc.js
module.exports = {
env: {
node: true,
browser: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@next/next/recommended",
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: "module",
},
plugins: ["react"],
rules: {
"react/no-unknown-property": ["error", { ignore: ["jsx"] }],
},
globals: {
React: "writable",
},
settings: {
react: {
version: "detect",
},
},
};
发布于 2022-09-03 04:29:29
您正在获得ESLint错误。我没有使用Vercel的经验,但我猜它正在构建用于生产的应用程序,并将警告作为错误处理。如果您在本地运行时没有看到这些错误,则可能是这样。为了帮助您解决确切的问题,您需要在抛出错误的行周围发布Product.jsx代码。
发布于 2022-11-27 22:17:30
您可以将eslint配置为忽略此规则的特定关键字,例如。
json语法:
...
"react/no-unknown-property": ['error', { ignore: ['css'] }]
...
或yaml语法:
react/no-unknown-property:
- error
- ignore:
- 'jsx'
- 'global'
请看文档:https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md
https://stackoverflow.com/questions/73589568
复制相似问题