-
Notifications
You must be signed in to change notification settings - Fork 345
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
[2.1.13] Suddenly not resolving modules anymore on working projects #1136
Comments
@Friksel does the validation happen correctly when you use eslint in the terminal. If this is the case can you please provide me with a GitHub repository I can clone that demos what you are experiencing. |
@dbaeumer Thanks for your response. When running When I make an error in my javascript and run eslint directly from the command line again it DOES report that error, so eslint is indeed linting. So to me it looks like eslint is running fine and the issue isn't in eslint nor its config. I'm keep on getting the |
@Friksel can you please provider me with a GitHub repository I can clone that demos this. |
Could be a working directory issue. You might want to have a look at the |
Sorry, I never send projects for obvious reasons. Also I'm using both webpack as well as eslint setups both pretty standard with webpack and eslint configs in the root of the projectfolder, together with the package.json. And it always worked fine that way (for years). But if you have a particular question I can always look of course.
I don't have that setting set. Never had either. So I would expect the default would be to look for a package.json in the root of the project (as a matter of fact I wonder why it's searching for the package.json), as that's the standard. I could try to set that setting manually, but I'm not sure where to set it too, as I would expect everything to be default. I've just tried adding the setting like this, but it doesn't help, still the same issues (also tried directory like
Could you please tell me how to set that setting to have the package.json in the root and confirm that's really necesary if I'm using standard locations for config files? Thanks |
The working directory setting is usually necessary if you have a multi project repository with different configs per folder. It is hard to say why this is not working for you unless I get a GitHub repository I can look at. If you can share your project could you distil a reproducible case. |
Having same issue, previously had this:
Removing it didn't help, resetting decisions didn't help, reinstalling the extension didn't help. |
@mvirbicianskas can you please provide me with a GitHub repository I can clone that demos what you are experiencing. |
hey @dbaeumer apologies, should've started with that, here's public library I just created https://github.com/mvirbicianskas/Eslint Not sure whether it's correct approach to share such stuff? UPDATE: take note Let me know if you have any additional questions |
@mvirbicianskas this works for me as expected |
@dbaeumer this is weird, I've restarted the editor multiple times and it didn't work, after quitting - it works ¯\(ツ)/¯ except for my project is still not working 😂 but apparently this is not extension's issue. UPDATE: in my case it was airbnb overriding some local rules thats why i got confused that some rules were applied and some not leading me into thinking that ESLint doesnt find/respect eslint config and falls back to some defaults. |
I don't have a multi-project repository. And so don't have different configs per folder. As said, the config was working fine before for years. Without that setting. Still I've tried the setting, but it didn't help.
As I wrote before I never send projects. And it shouldn't be necesary to debug this issue. If you have a thing I can check or have a question I'm happy to look and answer. It would also be appreciated if you could answer the question I asked you above:
|
The working directory setting you use is basically a noop since using the workspace root is the default. An example on how this setting is supposed to be used is here: https://github.com/microsoft/vscode-eslint#settings-options look for the bullet about Since ESLint depends on so many parameters (version, plugins, configuration files, package.json entries, and eventually webpack configuration and TS configuration files) debugging this does from my experience require an example. Otherwise it is very unlikely that we ever talk about the same setup. If you can't share your repository publicly you can add my GitHub id to it and I will receive a notification on how to clone it. |
Why then did you give this advise in the first place? Come on man, read my posts before advising.
A good developer knows what questions to ask. Requesting a full project from a user to debug an issue in your own extension is pretty lame to me. Also I already gave you the version numbers in my opening post. Several times I now asked you to ask questions so I can help you, but you refuse to ask these questions. You obviously don't want to help. I quit helping you debugging the issues in your extension now. You obviously don't want to fix this nor recognise this issue. This is the last post I posted about this as you're wasting my time. |
whoa there, @Friksel chill dude. I don't think you're being asked to provide full project repo. See my example above - try to reproduce the issue in a separate repository with as minimal configuration as possible and if it happens that it's really a bug inside the extension you will have to share that minimal reproduced repo here. |
@mvirbicianskas thanks for jumping in. You are correct I don't need the full repository, a distilled version is enough which I tried to point out in this comment #1136 (comment) via
This is also documented in our issue guidlines: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions#writing-good-bug-reports-and-feature-requests @Friksel ESlint and most of its plugins and configurations resolve files relative to a current working directory. So if ESLint can't find certain files than in many cases the current working directory is not correct. The setting I pointed you too gives you control over the working directory the eslint server is using when validating certain files. |
@dbaeumer Doing more testing the issue has to do with the latest version of the Eslint package which was released 12 days ago (or something that stopped working with that version) in combination of npm vs pnpm and the vscode-eslint extension. When downgrading to an earlier version, I just tested 7.11.0 up to right before 7.14.0, so right before the latest version 7.15.0 (updates also automatically update the packages Before I never had set the setting Looking at the change log of eslint 7.15.0 it doesn't seem to be a huge update though, so not sure what's causing this update to let vscode-eslint fail resolving while earlier versions where working fine. I also notice that eslint 7.15.0 and the vscode-eslint extension DO work when moving the project completely from This is project dependent though, as all projects here DO work with pnpm and [email protected] (and related packages)/ vscode-eslint, except for two projects where all packages have the same versions. And I even did a complete refreshed install with I also ran a But none of this seem to help. The only thing that's directly comes into mind by comparing all projects that work and the two projects that don't is that the non-working projects use the package
Yes, I know that by now. But the working directory IS okay and as I said many times now it always worked too and as you can see in this post it IS working when using NPM and it is even working in the project showing this issue (that was working for years) when switching eslint back to 7.14.0, so one version before the last update which happens to be released exactly 12 days ago. But I'm talking to a wall here. |
Alright. The issue didn't have anything to do with Eslint, nor everything related. There is an issue in the latest version of the Just found out there are more people with the same issue here: Not sure why vscode-eslint is more sensitive to this than direct command line eslint though, as that wasn't showing any error nor stopped the process, but at least found the issue now finally. Sorry for all the inconvience. Closing this issue now. |
I am happy to hear that you could solve the issue. |
You are my hero! Thanks! |
For some reason the eslint extension cannot find/resolve NONE of the modules anymore on a working project that was finding everything before without issue. It looks like this is a change in the extension I don't know about or an issue.
At first when I saw this I thought I needed to upgrade the eslint package, so I'm at the latest version of eslint now, but without success.
Looking in the Output panel though I see this a weird error thrown by the extension (by eslintServer.js):
Which makes sense that it cannot find it as my package.json is in the root of the project, as normal, but shouldn't look there in the first place. Not sure why it's searching in some webpack folder the project doesn't even have, but it's obvious that it cannot find it there.
The ESLint label in the bottomright corner is marked with a double checkbox, so it's not blocked or whatever.
[edit] I see that at least v2.1.10, v2.1.8 and v2.1.7, so the previous three versions, have the exact same issue and same error message in the output. But I didn't change anything AFAIK to both the project as well as to the installed modules. I'm at the latest version of VS Code for a while now (1.51.1) and didn't have this problem recently. Also just checked for updates on VS Code but there weren't any.
This was definitely working last week and didn't change anything manually since, so beats me what's going on.
It's now suddenly broken in ALL projects, so definitely not project-related. I'm using the locally installed eslint package on each project.
Something I need to know? Some change in the settings maybe I'm not aware of? Do we need to manually set the location of the package.json now or something? Is this a known issue in the extension?
Further info:
The text was updated successfully, but these errors were encountered: