Daniel J Abraham
Daniel J Abraham

Reputation: 254

Visual Studio IDE Doesn't Recognize EJS Variable in Javascript

I am making a project in Nodejs with the express framework I am using EJS as a template engine, I use Visual Studio as an IDE.

I have a problem while using EJS variable in the same ejs file, it renders correctly and works perfectly but Visual Studio marks it an error at the syntax

Is there any Tools or Extensions Features available, To overcome this issue

Error shown in IDE

enter image description here

Any one please help in solving this error in Visual Studio.

Upvotes: 0

Views: 957

Answers (1)

kRiZ
kRiZ

Reputation: 815

Right-click any given *.ejs file, and Select "Open With". In the dialog that opens, select "HTML (Web Forms) Editor" and select it as default.

Now, when you open your EJS files, you will get syntax highlighting and intellisense for your HTML. This does not give you support for EJS Code snippets, but will not throw errors.

Upvotes: 1

Related Questions