When upgrading an existing React project I'm getting the following error at line 0 of every .tsx file.
在升级现有的Reaction项目时,我在每个.tsx文件的第0行收到以下错误。
Parsing error: DeprecationError: 'originalKeywordKind' has been deprecated since v5.0.0 and can no longer be used. Use 'identifierToKeywordKind(identifier)' instead.
分析错误:DeproationError:自v5.0.0起,已弃用“”OriginalKeywordKind“”,无法再使用。“”请改用‘IdentifierToKeywordKind(IDENTIFIER)’。
How can I diagnose and remove the error?
如何诊断和删除错误?
更多回答
Having updated libs:
已更新libs:
@typescript-eslint/eslint-plugin
@typescript-eslint/parser
to versions 6.x resolved the problem.
6.x版本解决了这个问题。
See https://github.com/typescript-eslint/typescript-eslint/issues/7155#issuecomment-1692384149 for additional details.
有关更多详细信息,请参阅https://github.com/typescript-eslint/typescript-eslint/issues/7155#issuecomment-1692384149。
It's fixed once I updated my eslint typescript packages.
"@typescript-eslint/eslint-plugin": "^6.x",
"@typescript-eslint/parser": "^6.x",
一旦我更新了我的eslint打字套装,这个问题就被修复了。“@tyescript-eslint/eslint-plugin”:“^6.x”,“@tyescript-eslint/parser”:“^6.x”,
npm install @typescript-eslint/eslint-plugin --save-dev
npm install @typescript-eslint/parser --save-dev
For me downgrading the versions of typescript and eslint worked.
对我来说,降级TypeScrip和eslint的版本很管用。
typescript: 5.1.6
eslint: 8.47.0
typescript:5.1.6 eslint:8.47.0
For Next.js projects upgrading eslint-config-next solves the error
对于Next.js项目,升级eslint-config-next可解决此错误
For my Next.js app what worked for me was:
对于我的Next.js应用程序,对我起作用的是:
- npm i @babel/eslint-parser
- Adding the line "parser": "@babel/eslint-parser" to my .eslintrc.json
So my final eslintrc.json was looks like this:
所以我最后的eslintrc.json是这样的:
{
"parser": "@babel/eslint-parser",
"extends": "next/core-web-vitals",
"rules": {
"react/no-unescaped-entities": [ ]
}
}
Same problem here, can't build my NextJS project.
The only solution for me was downgrading typescript (5.1.6) and eslint (8.47.0).
这里也有同样的问题,无法构建我的NextJS项目。对我来说,唯一的解决办法就是降低TypeScrip(5.1.6)和eslint(8.47.0)的等级。
For me I found that downgrading the @types/node version from 20.5.7 to 20.5.6 fixed the issue.
对我来说,我发现将@Types/Node版本从20.5.7降级到20.5.6可以解决这个问题。
I have typescript 5.2.2 and eslint 8.48.0
我有打字稿5.2.2和eslint 8.48.0
Adding "next/babel" to .eslintrc.json fixed the problem for me
在.eslintrc.json中添加“Next/Babel”为我解决了这个问题
更多回答
How can I do this for CRA?
我如何才能为CRA做到这一点?
I already had @typescript-eslint/eslint-plugin
in place and npm install @typescript-eslint/eslint-plugin --save-dev
failed due to a dependency conflict, but npm install @typescript-eslint/parser --save-dev
worked and it fixed it for me 👍 thanks!
我已经有了@tyescrip-eslint/eslint-plugin,npm install@tyescript-eslint/eslint-plugin--save-dev由于依赖冲突而失败,但是npm install@tyescript-eslint/parser--save-dev起作用了,并且它为我修复了它👍谢谢!
Awesome fixed bro
太棒了,修车兄弟
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
您的答案可以通过其他支持信息来改进。请编辑以添加更多详细信息,如引用或文档,以便其他人可以确认您的答案是正确的。你可以在帮助中心找到更多关于如何写出好答案的信息。
only the typescript downgrade needed in my case
在我的情况下只需要打字稿降级
I needed to downgrade both TypeScript to 5.1.6
and Eslint to 8.47.0
to get my Next.js project building again.
我需要将两个类型的脚本都降级到5.1.6,将Eslint降级到8.47.0,才能重新构建我的Next.js项目。
Not only this lib
不光是这个自由党
Didn't work for my Next.js 13.4.19
project unfortunately.
不幸的是,我的Next.js 13.4.19项目不起作用。
Just tried this and still have the issue, are you sure you did not changed something else ?
刚刚试过了,还是有问题,你确定你没有更改其他东西吗?
我是一名优秀的程序员,十分优秀!