0

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.

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. Now the error disappeared, But as you said syntax highlighting and IntelliSense still doesn't work for EJS Code. If you come across any solution, please share.
Sure... I will update. Also, please have an eye on Visual Studio release notes too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.