Ar7hurz1nh0
Ar7hurz1nh0

Reputation: 764

Visual Studio Code syntax highlighting is not working for JavaScript and TypeScript

This suddenly happened after I created a new file while working on a project. Almost all characters are simply white text (except for brackets, because I have bracket pair colorization enabled)

First image showing how JavaScript and TypeScript syntax highlighting is not working

second image showing how JavaScript and TypeScript syntax highlighting is not working

third image showing how JavaScript and TypeScript syntax highlighting is not working

I already tried resetting my configurations, checked my configurations (both globally and in my workspace), and tried this extension that offers an alternative syntax highlighting (which worked, but I would prefer using the Visual Studio Code one).

Upvotes: 82

Views: 35855

Answers (8)

Joel
Joel

Reputation: 131

In my case I had to remove "workbench.colorTheme": "Visual Studio Dark" from settings panel.

As for your settings, you can open your them through the command palette:

  • Press F1
  • Type user settings
  • Press Enter
  • Click the "sheet" icon to open the settings.json file: settings icon
  • Remove workbench.colorTheme": "Visual Studio Dark",

if you don't have these lines, then just remove all lines it should work.

screenshot

Upvotes: 10

Haneen
Haneen

Reputation: 1146

I think this was caused by the extension called JavaScript and TypeScript Nightly. This was causing the syntax highlighting for .js and .ts files (.jsx and .tsx too). This was more of a bug with the latest version (currently 1.73.1).

You can disable the extension to enable the syntax highlighting.

JavaScript and TypeScript Nightly


This extension has now been updated and this issue is fixed.

Upvotes: 181

Vitalii
Vitalii

Reputation: 11

It was fixed with the latest update of JavaScript and TypeScript Nightly.

Upvotes: -2

Tanner
Tanner

Reputation: 868

As others mentioned, the two latest versions are causing issue for me, but 5.20221115 is working for me.

Upvotes: -1

Abdulrahim Klis
Abdulrahim Klis

Reputation: 493

Also, I deleted this JavaScript and TypeScript Nightly package, and now it works fine for me.

The module on the marketplace: JavaScript and TypeScript Nightly

Upvotes: 0

varun krishna
varun krishna

Reputation: 463

The current version (v5.0.20221116) for JavaScript and TypeScript Nightly seems to be breaking the syntax highlighting. Downgrading to a previous version might resolve this issue.

Enter image description here

This was resolved in v5.0.20221117 however.

Upvotes: 2

Josh Thomas
Josh Thomas

Reputation: 1687

Yes, this is exactly caused by the JavaScript and TypeScript Nightly extension.

You can disable or install another version (I recommend installing the prior version since the current version has a bug).

Enter image description here

I am currently using the version which was released 2022-11-13.

Enter image description here

Upvotes: 19

geoili
geoili

Reputation: 299

What user Haneen said was correct, but instead of disabling it, you can install an old version that works just fine.

Click the cog on the bottom right → 'Install Another Version' → select an older version.

Cog at bottom right

Upvotes: 33

Related Questions