Skip to content

Error unable to resolve path to module eslint import/no-unresolved after upgrading to 4.2.1 from 3.7.0 #396

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

Closed
alexleboucher opened this issue Mar 18, 2025 · 15 comments

Comments

@alexleboucher
Copy link

After upgrading my projet from 3.7.0 to 4.2.1, all my imports have error unable to resolve path to module eslint import/no-unresolved

I use ESLint 9 flat config.
There was no errors in version 3.7.0. I read the docs again and I don't think I need to change anything in my config (or maybe I missed something)

You can easily reproduct the issue by cloning my project : docker-express-postgres-boilerplate and upgrading the library

@JounQin
Copy link
Collaborator

JounQin commented Mar 19, 2025

Image

I don't get any errors, please provide the reproduction steps.

@michael-koch787
Copy link

I'm getting those errors too after upgrading, but only from vscode's eslint extension.

@JounQin
Copy link
Collaborator

JounQin commented Mar 19, 2025

I'm getting those errors too after upgrading, but only from vscode's eslint extension.

The new major version uses a napi module: rspack-resolver under the hood, if the cli works and VSCode ESLint fails, maybe reporting to them?

Either way, please provide a minimal but runnable reproduction when reporting issues.

@alexleboucher
Copy link
Author

alexleboucher commented Mar 19, 2025

Hi,

Yes I was not very clear, sorry. The errors are in VS Code.
Still reproductible in 4.2.2

Image

@SukkaW
Copy link
Collaborator

SukkaW commented Mar 19, 2025

Hi,

Yes I was not very clear, sorry. The errors are in VS Code. Still reproductible in 4.2.2

Image

Have you tried restarting the VSCode's ESLint server to see if the issue persists? Cmd + P then type >ESLint: Restart ESLint Server.

@alexleboucher
Copy link
Author

Hi,
Yes I was not very clear, sorry. The errors are in VS Code. Still reproductible in 4.2.2
Image

Have you tried restarting the VSCode's ESLint server to see if the issue persists? Cmd + P then type >ESLint: Restart ESLint Server.

Yes, of course. I even tried to quit and restart VS Code

@akinnee
Copy link

akinnee commented Mar 22, 2025

Restarting the eslint server does make the errors go away, but then whenever I create a new file or move some files around, I have to restart it again for it to properly resolve the new paths. I also didn't experience this on v3.7, but I do on v3.8.

EDIT: I take it back, I am still seeing it after downgrading to 3.7. I wonder if there is some other dependency that was upgraded at the same time that is causing it. Sooooooo annoying. 🔥 🐶 ☕ 🔥

@prenaissance
Copy link

For me it's the other way around - VSCode's eslint server produces no errors and the cli produces errors :D

Description and reproduction steps left under another issues: #393 (comment)

@JounQin
Copy link
Collaborator

JounQin commented Mar 26, 2025

Please help to try [email protected] which adds new 4 targets support:

  • i686-pc-windows-msvc
  • armv7-unknown-linux-musleabihf
  • powerpc64le-unknown-linux-gnu
  • s390x-unknown-linux-gnu

@alexleboucher
Copy link
Author

Please help to try [email protected] which adds new 4 targets support:

  • i686-pc-windows-msvc
  • armv7-unknown-linux-musleabihf
  • powerpc64le-unknown-linux-gnu
  • s390x-unknown-linux-gnu

I just upgraded to 4.3.2 and I don't have the errors anymore. I guess I can close this issue.
Thanks

@JounQin
Copy link
Collaborator

JounQin commented Apr 7, 2025

Glad to hear!

@MrPiao
Copy link

MrPiao commented Apr 7, 2025

I was having the same issue (I have the no errors in CLI, errors in VS Code variant), and for me upgrading to 4.3.2 re-introduces the issue. 3.7.0 still works fine for me.

@JounQin
Copy link
Collaborator

JounQin commented Apr 7, 2025

I was having the same issue (I have the no errors in CLI, errors in VS Code variant), and for me upgrading to 4.3.2 re-introduces the issue. 3.7.0 still works fine for me.

@MrPiao Please provide a runnable reproduction to microsoft/vscode-eslint#1994

@MrPiao
Copy link

MrPiao commented Apr 8, 2025

I'll try to find some time to generate one

@renchap
Copy link

renchap commented Apr 11, 2025

I commented in the linked ticket, but I managed to figure out that this is caused by <root> not being correct when eslint is ran for vscode, in a monorepo setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

8 participants