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
TypeError: Cannot read property 'replace' of undefined
when using import type
#72
Comments
Hi! I tried this out quickly and couldn’t reproduce. But you didn’t post your .eslintrc etc so it’s hard for me to know if I’m doing exactly the same thing as you. Edit: Oops, just saw that there was a collapsed “Configuration” part in your message, re-checking… Can you create a minimal repo that causes the error that I can clone to easily reproduce your error? Preferably using |
Update: Now that I found your .eslintrc I wasted a bunch of time trying to figure out all the bazillion of ESLint plugin it depends on so I could finally run your config. Still no luck reproducing. So, please create a minimal repo that reproduces the error. In general, it’s nice to do that when reporting issues. Don’t waste maintainers’ time trying to reproduce your issue – let them dive into the code and fix it for you as soon as possible. Thanks! 🙏 |
Hi, Lydell -- I created https://github.com/bonnie/import-type-eslint-crash to demonstrate the issue. It is a project created with create-react-app,
You can trigger the ESLint crash by running I understand that this should not pass linting as it is an incomplete statement; however it should not crash ESLint. |
Thanks! Now I can reproduce. And thanks for trying to reproduce without create-react-app, that’s really helpful to know. I’ll try to dig deeper into this when I get the chance. |
Alright, I did some digging. Turns out create-react-app had nothing to do at all with it – after some poking around it was rather easy to extract only the ESLint parts. Next time, I’m sure you’d make it too with some more effort! The problem is that So follow that issue and pray it’ll be fixed! |
Got it, Thanks Simon! |
The following is from eslint/eslint#14554 which I filed with ESLint; I was advised to file with this project as the error is in
eslint-plugin-simple-import-sort
.Tell us about your environment
Node version: v15.13.0
npm version: v7.9.0
Local ESLint version: v7.25.0
Global ESLint version: v7.23.0 (Currently used)
Operating System: darwin 18.6.0
What parser (default,
@babel/eslint-parser
,@typescript-eslint/parser
, etc.) are you using?@typescript-eslint/parser
Please show your full configuration:
Configuration
I am running ESLint via the
dbaeumer.vscode-eslint
extension in VSCode, Version 2.1.20. These are the extension settings I'm using:My VSCode settings are:
Typing this code will reliably set off the error, usually twice:
What did you expect to happen?
No error
What actually happened? Please copy-paste the actual, raw output from ESLint.
I can reliably reproduce the following error (usually two times) by typing
import type {} from
:Steps to reproduce this issue:
eslint-plugin-simple-import-sort
(I'm using version 6.0.1)dbaeumer.vscode-eslint
extension (version 2.1.20) on VSCode (I'm using version Version: 1.55.2)import type {} from
ESLint: Cannot read property 'replace' of undefined
will occur (usually two times)Note: this seems to be new-ish behavior, though I can't pinpoint exactly when it started.
The text was updated successfully, but these errors were encountered: