Issue with EJS Templating Syntax Highlighting and Rendering in Visual Studio Code

27 views Asked by At

I'm currently working on a JavaScript project using EJS (Embedded JavaScript Templates) in Visual Studio Code and encountering a couple of issues that I need help with.

Environment:

  • ubuntu Studio
  • Visual Studio Code
  • Node.js (v21.5.0)
  • Express.js
  • EJS

Problem:

  • Syntax Highlighting: The EJS syntax, specifically <%= %> tags, is not being recognized by Visual Studio Code. The tags are highlighted in red as if there's a syntax error.

  • Rendering Issue: When attempting to view my EJS templates in the browser, nothing is displayed. It seems like the server isn't properly rendering the EJS templates.

Questions:

  • Are there specific settings or configurations within Visual Studio Code that I need to adjust to enable proper rendering and display of EJS templates in the browser?
  • Could there be any some misconfigurations in my server setup that might prevent EJS templates from rendering correctly?

Any insights, advice, or resources you could provide would be greatly appreciated. Thank you in advance for your help!

  • I've checked my server setup to ensure it's configured to use EJS as the view engine, with app.set('view engine', 'ejs');.
  • I've attempted to look for EJS extensions in Visual Studio Code's marketplace but am unsure which one would best resolve the syntax highlighting issue.
0

There are 0 answers