nuxt / nuxt/devtools

When using `pug` templates with `devTools` enabled: `Illegal tag name. Use '&lt;' to print '<'.`

Open
#259 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug has workaround upstream
Dominant language
TypeScript
Stars
3.3k
Forks
214
Avg merge
13h 22m
Merged PRs (30d)
18

Description

Environment

  • Operating System: Linux
  • Node Version: v16.14.2
  • Nuxt Version: 3.5.3
  • Nitro Version: 2.4.1
  • Package Manager: npm@7.17.0
  • Builder: vite
  • User Config: devtools
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-78ly8d?file=nuxt.config.ts

Describe the bug

When using pug templates with devTools enabled, I can't use the < or > operators inside attributes. They cause this error: Illegal tag name. Use '&lt;' to print '<'. When I disable devTools, the problem goes away.

Additional context

No response

Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction and inspect nuxt.config.ts, first confirming the difference between devTools enabled and disabled. Trace how the devTools integration interacts with the Pug template containing < and > in attributes. Done means those operators compile and run in Pug attributes while devTools remains enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxtjs, pug, typescript, vite
Domain
devtools, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.