-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 'lastIndexOf' of undefined after upgrading from 2.23.4 to 2.24.1 #2199
Comments
Same here |
That repo unfortunately doesn't reproduce the issue for me (with @mmakarin do you have a repro repo? |
Also, your stack trace seems like the error is coming from I'll be happy to reopen this if I can reproduce it and if the error is coming from projects in this repo. |
@ljharb This happens to me as well. |
@jjangga0214 i believe it’s happening, but if it’s an error in eslint-import-resolver-typescript, that’s not a package i maintain and isn’t part of this repo. |
I also got this, only after updating to 2.24.1. I'm trying to create a repro now. |
Partial info: This triggers on a line like:
import {a} from './b'; where export * as b from './c'; And However, I recreated this precise setup in a standalone repo, and couldn't repro. So there's a necessary element I'm missing. Separately, when inspecting the function processSpecifier(s, n, m) {var nsource = n.source && n.source.value; console.log({n}); I see the following output:
And it does not appear that |
When I add that same console line in the repo where the issue doesn't repro, the line isn't hit at all. So it appears that Does that help any figuring out what's going on? Ha. |
It might be the case that resolvers weren't previously passed I'll try to create a failing test case; if I can, then we can solve it (but either way, it would be ideal to file a bug on the typescript resolver's repo) |
ah - looks like we have a bunch of test failures (24) when I install eslint-import-resolver-typescript v2 locally - we only test with v1 atm. None of those failures, however, are this crash :-/ (many are In the meantime, I could certainly avoid calling @NickHeiner can you confirm that if you edit those two lines doing |
That doesn't quite work. {
type: 'ExportAllDeclaration',
source: {
type: 'Literal',
value: './constants',
raw: "'./constants'",
range: [Array],
loc: [Object]
},
exportKind: 'value',
exported: {
type: 'Identifier',
name: 'clConstants',
range: [Array],
loc: [Object]
},
range: [ 635, 678 ],
loc: { start: [Object], end: [Object] }
} Whereas I think
If I do import {doesNotExist} from './b'; |
what is |
I assume it would still be |
Upgrading to |
Seems like a bunch of people are getting this – can someone other than me try to make a repro (since I failed at it)? Or at least share what pattern it's happening on? Or at least say whether what I pasted above matches what you're seeing? 😄 |
I was already downgrading and had lost the exact error message, but the callstack had the Webpack ESLint Resolver in it, so I think that whatever the issue is is not related to any specific resolver, although it certainly seems there's some interplay here. I'll try to remember, at the end of my day, to reinstall |
@NickHeiner @slapbox i'm going to cut a patch release shortly; if there's any way to try out the latest default branch of the plugin and confirm that it'll fix your problem, that would be most helpful. |
You mean you're going to publish a pre-release version to npm, right? Yes, I'm happy to test that. |
No, I'm going to publish the real one :-) i was just hoping to confirm from git-based testing in the meantime. |
v2.24.2 is released; please give it a shot. |
I tried it. I no longer get the crash, but when I change the import to be an invalid name, I no longer get a lint error. (I do get a TS error.)
|
No crashes with v2.24.2! Thank you @ljharb! |
Should I open a new issue to track the error where |
@NickHeiner I would say yes. |
Yes, that would be great, thanks. |
Steps to Reproduce
npm install
npm run fix:eslint
Repo link - https://github.com/tmtsoftware/esw-ocs-eng-ui/tree/eslint-plugin-import-issue
Branch - eslint-plugin-import-issue
The text was updated successfully, but these errors were encountered: