-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrading to 3.8.1 causes "Failed to load parser '@typescript-eslint/parser'" #203
Comments
I've just encountered the same issue after upgrading to 3.8.1 The error I get is:
Installing |
@lewishowles & @CosAnca please try this beta version:
|
For me, that stops it erroring with regards to parsers, but it still gives an error I saw originally that I struggled to pin down, which is actually coming back to an eslint-plugin-vue function in one of my Vue components. But I think that's a red herring as turning that rule off shows the same error in another rule, removing that component shows it in another, and so on. In case it's useful I see this:
Again going back to 3.8.0 stops the error occurring. |
@lewishowles, how did you configure the linting of overrides: [
{
files: ['*.html', '*.blade.php', '*.vue'],
parser: '@angular-eslint/template-parser',
},
{
files: ['*.ts', '*.tsx', '*.js'],
parser: '@typescript-eslint/parser',
},
], What parser are you using, maybe I should switch to yours by default for vue files. |
I haven't changed anything in my eslintrc - it could be that I need to. I believe it's just using
and then I'm using eslint-plugin-vue via
|
Though I do need to rebuild these projects using Vite, which is on the list... That might change exactly how the linting is set up. |
@francoismassart Upgraded to the recommended beta version but still getting errors.
I'm on the latest estlint version 8.32.0 and this is my eslint config
Downgraded eslint-plugin-tailwindcss to 3.7.1 for now where there are no errors thrown. |
If you install |
@charkour Not for me, no. It moved the complaint to The beta version from @francoismassart seems to remove that but allows the other issue to surface, but it looks like there's progress there. |
Still getting the same error as above after installing |
@lewishowles, @charkour, @CosAnca 👉 Are you also getting these errors using It seems like setting a default
If I read through the I only saw it in 👉 What parser are you using for Thank you for your feedback |
If someone have a project A that use an eslint plugin B I don't understand why html parser could not be a dependency of this eslint plugin that want to cover lint in various files and contexts |
@francoismassart No errors at all on For parsers I am only specifying the one above, |
@Shuunen , the bundle size I'm talking about is the total bundle size of eslint-plugin-tailwindcss and its dependencies. I don't think it is a best practice to define the parser in the preset, I might be wrong, I'm no eslint expert 😅 Apart from the bundle size aspect, the issue is that it will overwrite the optional existing parser setting:
Let's say you need 2 different parsers for the same file extension, I don't know if this can be done... |
@Shuunen, @lewishowles, @CosAnca & @charkour I just published which uses This might fix it, please test it out 🙏 |
I'm personally not getting any more errors using Thanks for your help. |
Faced the same issue when tried to use with react without typescript node:internal/event_target:1006
process.nextTick(() => { throw err; });
^
Error: Failed to load parser '@typescript-eslint/parser' declared in '.eslintrc.cjs » plugin:tailwindcss/recommended#overrides[1]': Cannot find module 'typescript' |
@retromack, are you using 👉 In the demo repo, I'm not using typescript and See the |
@francoismassart yes i'm using |
@retromack would you mind publishing a simplified / minimalist copy of the project on a repo, so that I can try to debug this ? Thanks |
Just to circle back, my team hasn't had any issues, but we were using Hope this helps. Thank you for your continued support! |
@francoismassart i tried deleting |
3.8.0 works stable 3.8.2 error
Project without typescript |
@gldkru, did you try to |
Yes, I did. I removed folder node_modules and yarn.lock file. |
@gldkru can you share your eslintrc ? |
{
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:prettier/recommended",
"plugin:tailwindcss/recommended",
"prettier"
],
"rules": {
"react/prop-types": 0,
"no-console": 1,
"react-hooks/rules-of-hooks": 2,
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [
1,
{
"extensions": [".ts", ".tsx", ".js", ".jsx"]
}
],
"no-nested-ternary": "off",
"import/prefer-default-export": "off"
},
"plugins": [
"react",
"jsx-a11y",
"react-hooks",
"tailwindcss"
],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"es6": true,
"browser": true,
"node": true,
"commonjs": true
},
"settings": {
"react": {
"version": "detect"
}
}
} |
Firstly thanks for the great plugin.
Describe the bug
I'm working on a Vue project. It's hard to pinpoint exactly what's causing this or dig deeper as running the lint fails, but I'm hoping something here triggers a thought. When updating to 3.8.1 this morning, my
eslint
runs started failing withFailed to load parser '@typescript-eslint/parser'
. If I manually install that to see what happens, it errors about an Angular parser, but this project doesn't use Angular.Before starting a new feature, I updated:
eslint
: 8.27.0 => 8.32.0eslint-plugin-tailwindcss
: 3.7.0 => 3.8.1eslint-plugin-vue
9.7.0 => 9.9.0The same versions of
eslint
andeslint-plugin-vue
are used in another project without problems, but that project is only runningeslint-plugin-tailwindcss
3.8.0.Downgrading to 3.8.0 fixes the issue.
Environment (please complete the following information):
eslint config file or live demo
Video: https://share.cleanshot.com/Xbzbym9V
eslintrc:
The text was updated successfully, but these errors were encountered: