Skip to content
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

VS Code frequently fails to load with ERR_MODULE_NOT_FOUND: Cannot find module 'C:\Program Files\Microsoft VS Code\resources\app\out\main.js' #233625

Closed
kevinkieselbach opened this issue Nov 11, 2024 · 15 comments
Assignees

Comments

@kevinkieselbach
Copy link

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.95.0
  • OS Version: Windows 11 24H2 26100.2033

Steps to Reproduce:

VS Code frequently fails to load with "A JavaScript error occurred in the main process": ERR_MODULE_NOT_FOUND: Cannot find module 'C:\Program Files\Microsoft VS Code\resources\app\out\main.js' (see screen shot).

Image

After hitting this error, I can’t use VS Code again until I reinstall it to fix the missing module (which often requires manually killing a stuck running instance of code.exe in Task Manager). I’ve been hitting this error for many months and it still repros after many VS Code updates (currently on 1.95.0). Sometimes I can go weeks between repros and sometimes (like today) it repros multiple times in the same day. Is this a known bug? If not, are there any logs you need besides the call stack in the screen shot to root cause and fix it?

Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.95.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@jack-kaiasm
Copy link

I got hit with this same error today after booting-up. I am on the most-recent version of VS Code (1.95.2) and updated 4 days ago.

Image

As OP said, this seems to happen regularly - perhaps once a month - at which point I have to reinstall. At the least it's a major inconvenience.

@joaomoreno
Copy link
Member

This will be fixed by #232990

@joaomoreno joaomoreno closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2024
@kevinkieselbach
Copy link
Author

@joaomoreno, the work item you linked says this is an issue with built-in extensions. Is this an issue with specific extensions or all extensions? The only extensions I have enabled are Microsoft's C++ and .NET extensions. Also, shouldn't this be resolved as something other than "not planned" if it will be fixed by a work item this month?

@ssougnez
Copy link

I just updated vs and I now have the issue.

@sagarpanchal8793
Copy link

sagarpanchal8793 commented Nov 20, 2024

I have been facing this issue since past 5+ months and frequency is about every 2 - 3 weeks and the solution is just re-install. The previous comment from @joaomoreno gave me some hope but then closing it as not planned is very disheartening. Would it be possible to fix the issue at a higher priority?

@totallymonkey
Copy link

I also have been facing this issue constantly. In fact, I have hit it twice in the past 2 weeks. It's frustrating to have to constantly reinstall. Is there anything that can be done to work around this problem, short of getting a fix?

@danagatley
Copy link

This is happening again 12/19/2024. This issues has not been fixed.

@gnida-rada
Copy link

Has nothing to do with version. Whenever it happens, I re-install from old installation .exe and the error goes away.
Pretty frustrating.

@iNandiEntrata
Copy link

happening still on 20th dec, 24
Image

@ssougnez
Copy link

I don't know if it helps but last time it happened to me was because I updated vscode while it was still running.

@Paul-Borisov
Copy link

Paul-Borisov commented Dec 23, 2024

A possible cause
A false positive at Microsoft Antivirus, which mistakenly treats VSCode's JS-files as a virus.

A possible fix, which works for me
Windows Security > Virus & threat protection > Exclusions > Add C:\Program Files\Microsoft VS Code

Image

Symptoms
I experienced the same issue with unexpected removals of the module when I was trying to use two instances of VSCode from my WSL setup. I have upgraded to the latest VSCodeSetup-x64-1.96.1.exe from December 19, 2024 with no difference.

  • Reinstallation helped, but I had to restore my VSCode extensions every time after that.

Image

The corrupted state:
Image

The repaired state (right after reinstalling VSCode):

Image

@gmj93
Copy link

gmj93 commented Dec 23, 2024

I have also been facing this issue frequently. The "update while running" might be a cause, as the company pushes updates periodically and I have no control of when they are applied. Today it happened again and there was an update.

It's very unfortunate that this issue is marked as closed/not planned as it severely affects user experience.

@kristjanvalur
Copy link

I've had this for a year, I think. Reinstall is only fix.

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 27, 2024
@joaomoreno
Copy link
Member

Merge with #52855

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

No branches or pull requests