Question Locked

VS Code undable to open files

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I use VS Code as my code editor. Today while I was working on a React app I was suddenly unable to open any files. My technical skill with VS Code is lacking so I have no idea what might have caused this.

This is the error I get: Unable to open 'index.js': Assertion Failed: argument is undefined or null.

It throws this error for every single file I try to open. If anyone might have some suggestions on what I can do to fix the problem I would be extremely grateful. I'm downloading Atom at the moment but I'd rather stick to VS Code for now as that's what I'm used to. Thanks in advance.

4 replies

by bendcode

I was having this same problem after messing around with my settings.json file. After clearing all content out of the settings.json file everything started working again. Maybe give that a try? Not sure.

by awduley

Thanks for the reply but I can't seem to find where my settings.json file is. I did some looking on the internet and I found a few places to check but no luck. Either vs code won't open the file I need, or I don't see a settings.json file anywhere in file explorer. I've even uninstalled and reinstalled the program multiple times but still no luck. I guess I'll just have to switch to the Atom editor.

by sergegl

Try to delete the contents of settings.json {}

Location per OS
Windows %APPDATA%\Code\User\settings.json
Mac $HOME/Library/Application Support/Code/User/settings.json
Linux $HOME/.config/Code/User/settings.json

Or you can remove one item at the time in that file and reload VS until you find what causes the issue.

by awduley

Thanks for both of your suggestions. I don't know why I couldn't seem to find my settings.json file {}. I found it today though. I deleted everything and now it's working just fine. I wonder what I did to mess it up in the first place.

Anyway, thanks again to both of you.

This discussion is closed to new replies.