Why VS Code contains emphasized items but no error?

ReactjsVisual Studio-Code

Reactjs Problem Overview


I'm writing a React project in VS code. I met this problem in VS code. In my project, this folder shows Contains emphasized items and I know it means there is an error in my files. But in the picture:

vs code project,

I have checked all files but no error was found. So this makes me feel confused.

I have searched this problem on google and found a similar GitHub issue. https://github.com/Microsoft/vscode/issues/54960

Hope someone can help me.

Reactjs Solutions


Solution 1 - Reactjs

Use the command, CTRL+SHIFT+P on windows or COMMAND+SHIFT+P on mac, then search "Developer: reload window", click on it, your vs will reload and enjoy your stress-free coding.

Solution 2 - Reactjs

Committing once with git can be resolved.

Solution 3 - Reactjs

I can solve the problem react-native start --reset-cache and by reloading VS with the command Ctrl + shift + p and searching Developer: Reload Window

Solution 4 - Reactjs

I saw this message after moving a file from one folder to another, renaming and committing everything to git.

The Visual Studio "Problems" window showed an issue with the "deleted" file. Somehow VS had left a window open for the original location of the file and in it's tab the file was labeled as "deleted". Closing that tab in VS got rid of the "Contains emphasized items"

Solution 5 - Reactjs

Had the same issue.

Committing multiple times from within the VS Code did not help.

However, once I added the files and committed from the shell, everything fell in place.

Solution 6 - Reactjs

In my case, the already deleted files were opened in the VS code. Closing those files resolved my issue.

Solution 7 - Reactjs

This is an edge case but I am putting it here just in case it helps someone in the future...

I had accidentally done a git add . before I had fully set up my .gitignore file, so it had staged a couple folders with hundreds of files (mostly the entire Electron out folder) that I definitely didn't want in the repo.

This is the procedure I went thru to clean up my staged files:

  • updated .gitignore so that when I reverted the add I could be sure that GIT was ignoring the right files and folders (which worked, hundreds to 7, the moment I did the git reset)
  • git reset -f
  • noting that the correct files were now in line to be staged, I did:
    • git add .
    • git commit -m "message"
    • git push

When I returned to the regular file list, I noticed that node_modules was showing the "emphasized items" indicator. So just to make sure that I had actually gotten everything committed and such I tweaked .gitignore again (added node_modules/** just in case lol), did another commit, and still had the issue. Nothing helped, and like I said, it was confusing because the indicated files were under node_modules and it was in the ignore list.

So I hit cmd-p and ran Developer: Reload Window. It turned out out all I had to do was reload the window and the emphasized items went away entirely. Simple fix, confusing problem.

Apparently adding, reverting, then adding a subset of my directories confused vs code and it just needed to reload the window.

Solution 8 - Reactjs

I had the same issue, pushing to git didn't solve the problem. I simply closed all files, cancelled my dev server and restarted VS Code. The emphasizing was gone.

Solution 9 - Reactjs

this work for me :

I can solve the problem react-native start --reset-cache and by reloading VS with the command Ctrl + shift + p and searching Developer: Reload Window

Solution 10 - Reactjs

git add . git commit -m "your commit description"

If this not helps, after commit restart the VS CODE

Solution 11 - Reactjs

Select this tab from toolbar - View -> Problems or Ctrl + Shift + M and on bottom Terminal you will see whats problem is it.

Solution 12 - Reactjs

This error is coming because sometimes we delete something so its need window reloading and to reload Type the command, CTRL+SHIFT+P on windows or COMMAND+SHIFT+P on mac, then search "Developer: reload window", click on it. It will reload the window and your error will be gone

Solution 13 - Reactjs

This error occurs because there are pending changes to be saved in git, so to solve this problem, open a command terminal and go to the folder where your project is located, execute the following commands

git add .
git commit -m "your commit description"

In my case it works with this.

Solution 14 - Reactjs

I noticed this when I working on a Rails application using Visual Studio Code editor.

I used an underscore for a directory name, that is instead of staticpages, I named the directory static_pages.

However, committing the code change using the below commands fixed it:

git add .
git commit -m "commit message"

That's all.

I hope this helps

Solution 15 - Reactjs

VSCode using React. Changed a folder name in the src folder. Would not pass compilation after changing names of components. Committed to git. Restarted the app with npm start. All is well.

Solution 16 - Reactjs

In my case files that had been deleted were still opened in VsCode. After closing them (and also git commit as other posts suggest) helped solved the problem

Solution 17 - Reactjs

You may have hidden files. My Explorer was not listing hidden files in those directories. Hidden files on Linux begin with a . (for example, .hidden.txt)

Solution 18 - Reactjs

0

When I was working on a angular application in the Visual Studio Code editor, I observed this. And resolved it by simply restarting VSCode.

Solution 19 - Reactjs

uninstall any extension if you have installed in vs code.It will be solved.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKimYuView Question on Stackoverflow
Solution 1 - ReactjsRhinolamerView Answer on Stackoverflow
Solution 2 - Reactjsweiya ouView Answer on Stackoverflow
Solution 3 - ReactjsRaul BritoView Answer on Stackoverflow
Solution 4 - ReactjsDaniel FlippanceView Answer on Stackoverflow
Solution 5 - ReactjshackernewbieView Answer on Stackoverflow
Solution 6 - ReactjsKishan LalView Answer on Stackoverflow
Solution 7 - ReactjsjrypkahauerView Answer on Stackoverflow
Solution 8 - ReactjsdlcView Answer on Stackoverflow
Solution 9 - ReactjsfrancotelView Answer on Stackoverflow
Solution 10 - ReactjsJagan Mohan BishoyiView Answer on Stackoverflow
Solution 11 - ReactjsErik P.View Answer on Stackoverflow
Solution 12 - ReactjsSonali MangrindaView Answer on Stackoverflow
Solution 13 - ReactjsJose FdoView Answer on Stackoverflow
Solution 14 - ReactjsPromise PrestonView Answer on Stackoverflow
Solution 15 - ReactjsJohnCanessaView Answer on Stackoverflow
Solution 16 - ReactjsŁukasz NiemkiewiczView Answer on Stackoverflow
Solution 17 - ReactjsFrank B.View Answer on Stackoverflow
Solution 18 - ReactjsHena fufaView Answer on Stackoverflow
Solution 19 - Reactjsshreedevi mView Answer on Stackoverflow