nuxt / nuxt/bridge

meta components don't render within pug

Open
#13 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bridge upstream-bug
Dominant language
TypeScript
Stars
285
Forks
33
Avg merge
22h 38m
Merged PRs (30d)
3

Description

Environment

  • Operating System: Linux
  • Node Version: v16.12.0
  • Nuxt Version: 2.16.0-27358576.777a4b7f
  • Package Manager: npm@8.1.0
  • Builder: webpack
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://codesandbox.io/s/meta-components-mfm825-mfm825?file=/pages/index.vue

/index.vue

<template lang="pug">
div
  Html.index-class(index-html-attr)
    Head
      Title index title
  h1 hello index
  div: nuxt-link(to="/foo") foo
</template>

/foo.vue

<template lang="pug">
div
  Html.foo-class
    Head
      Title foo title
      Script(src="/foo-script-nested-in-html-tag.js")
  Script(src="/foo-script-out-of-html-tag.js")
  h1 hello foo
  div: nuxt-link(to="/") index
</template>
Describe the bug

The repro demonstrates several bugs:

  • Html tag's class not work.
  • Title not work.
  • Script nested in Html not work
Additional context

No response

Logs
[Vue warn]: "class" is a reserved attribute and cannot be used as component prop.
[Vue warn]: "is" is a reserved attribute and cannot be used as component prop.
[Vue warn]: "slot" is a reserved attribute and cannot be used as component prop.
[Vue warn]: "style" is a reserved attribute and cannot be used as component prop.

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 /index.vue and /foo.vue reproductions in the linked CodeSandbox, comparing the Pug templates with their rendered output and the listed Vue warnings. Verify the Html class, Title, and nested Script behavior in both pages; done means these meta components render with their attributes, titles, and scripts as shown in the examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
pug
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.