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
[Bug]: Parsing error: Cannot read property 'push' of undefined #13331
Comments
Can you attach the entire stack trace? Because it may be an error in your configuration. |
Sure, I've updated the description. |
Yeah, I just gave another quick look to your babel configuration and |
This is likely a regression introduced in #13199 The error is thrown from
If If it is the first time that you contribute to Babel, you can follow these steps: (you need to have
|
Nice :) |
Perfect, thanks for your analysis! |
Hello, I would need some help on writing the tests, In babel/tree/main/eslint/babel-eslint-parser/test there is only one index.js file and I am not sure on how to extend it. For the moment, I have just pushed 46d5470e36d2435d59eb28028a8c9d8505b4d4f1. Thanks for your help, |
Yeah, in this case we need a test in https://github.com/babel/babel/blob/main/eslint/babel-eslint-parser/test/index.js and not an You could try passing |
Hi, I've created #13338 which is now under review. Subsidiary question: why some parts of Babel are written in TypeScript, some others not? |
We are slowly migrating to TS! Currently some files are plain JS, some use Flow and some us TS. |
Fixed by #13338, it will be released in the next patch. |
💻
How are you using Babel?
@babel/eslint-parser
Input code
Here is the repository: https://github.com/devfservant/babel-eslint-parser-error/
Configuration file name
babel.config.js
Configuration
Current and expected behavior
Current behaviour
The command
npx eslint "packages/**" --debug
is crashing with the error:(see babel-eslint-parser-error#debug-logs for more details)
Expected behaviour
No error
Environment
System:
OS: Windows 10 10.0.19042
Binaries:
Node: 12.20.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.10 - C:\Program Files\nodejs\npm.CMD
Monorepos:
Yarn Workspaces: 1.22.10
Lerna: 4.0.0
npmPackages:
@babel/cli: ^7.13.16 => 7.14.3
@babel/core: ^7.14.2 => 7.14.3
@babel/eslint-parser: ^7.14.2 => 7.14.3
@babel/eslint-plugin: ^7.13.16 => 7.13.16
@babel/plugin-syntax-dynamic-import: ^7.8.3 => 7.8.3
@babel/plugin-transform-runtime: ^7.14.2 => 7.14.3
@babel/preset-env: ^7.14.2 => 7.14.2
@babel/preset-react: ^7.13.13 => 7.13.13
@babel/runtime-corejs3: ^7.14.0 => 7.14.0
babel-plugin-styled-components: ^1.12.0 => 1.12.0
babel-plugin-transform-assets-import-to-string: ^1.2.0 => 1.2.0
eslint: ^7.26.0 => 7.26.0
jest: ^26.6.3 => 26.6.3
lerna: ^4.0.0 => 4.0.0
Possible solution
No response
Additional context
I faced this issue using a monorepo project (managed with lerna).
I got this error when switching from
babel-eslint
/babel-eslint-plugin
to
@babel/eslint-parser
/@babel/eslint-plugin
(following https://babeljs.io/blog/2020/07/13/the-state-of-babel-eslint#the-future and https://stackoverflow.com/a/63489530/12292636)Thanks a lot for your help,
if I can contribute just tell me and I'll try to do my best 🙏
The text was updated successfully, but these errors were encountered: