question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to load component `hgroup` - HTML5 attribute

See original GitHub issue

Environment


  • Operating System: Linux
  • Node Version: v16.15.1
  • Nuxt Version: 3.0.0-rc.3
  • Package Manager: yarn@1.22.18
  • Builder: vite
  • User Config: target
  • Runtime Modules: -
  • Build Modules: -

Reproduction

index.vue

<template>
<hgroup>
  <h1>heading</h1>
  <h2>sub-heading</h2>
</hgroup>
</template>

Describe the bug

hgroup is a html5 attribute but nuxt is trying to load it as a component

Additional context

No response

Logs

ℹ Vite client warmed up in 1034ms                                                                                                                                                                                   
ℹ Vite server warmed up in 104ms                                                                                                                                                                                    
✔ Vite server built in 719ms                                                                                                                                                                                        
✔ Nitro built in 292 ms                                                                                                                                                                                             
[Vue warn]: Failed to resolve component: hgroup
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Failed to resolve component: menuitem
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[nitro] [dev] [unhandledRejection] TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at normalizePropsOptions (.../node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3966:11)
    at createComponentInstance (.../node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6957:23)
    at renderComponentVNode (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:171:22)
    at Module.ssrRenderComponent (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:608:12)
    at _sfc_ssrRender (file://.../.nuxt/dist/server/server.mjs:3805:31)
    at renderComponentSubTree (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:253:13)
    at renderComponentVNode (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:188:16)
    at renderVNode (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:295:22)
    at renderComponentSubTree (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:259:13)
[Vue warn]: Failed to resolve component: hgroup
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Failed to resolve component: menuitem
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[nitro] [dev] [unhandledRejection] TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at normalizePropsOptions (.../node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3966:11)
    at createComponentInstance (.../node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6957:23)
    at renderComponentVNode (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:171:22)
    at Module.ssrRenderComponent (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:608:12)
    at _sfc_ssrRender (file://.../.nuxt/dist/server/server.mjs:3805:31)
    at renderComponentSubTree (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:253:13)
    at renderComponentVNode (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:188:16)
    at renderVNode (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:295:22)
    at renderComponentSubTree (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:259:13)
[Vue warn]: Failed to resolve component: hgroup
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Failed to resolve component: menuitem
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[nitro] [dev] [unhandledRejection] TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at normalizePropsOptions (.../node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3966:11)
    at createComponentInstance (.../node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6957:23)
    at renderComponentVNode (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:171:22)
    at Module.ssrRenderComponent (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:608:12)
    at _sfc_ssrRender (file://.../.nuxt/dist/server/server.mjs:3805:31)
    at renderComponentSubTree (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:253:13)
    at renderComponentVNode (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:188:16)
    at renderVNode (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:295:22)
    at renderComponentSubTree (.../node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:259:13)
✔ Vite server built in 121ms
✔ Vite server built in 53ms

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
huang-juliencommented, Jun 9, 2022

hasn’t it been excluded from the W3C HTML specs ? if you really want to use it, try

export default defineNuxtConfig({
    vue: {
     compilerOptions: {
         isCustomElement: (tag) => tag === "hgroup"
     }   
    }
})
1reaction
Sigmanificientcommented, Jun 9, 2022

Do you have an official list for html5 that are not depreciated? That would help me a lot Apparently, my list is not up to day

You can just check the list of tags at: https://developer.mozilla.org/en-US/docs/Web/HTML/Element?retiredLocale=it

AFAIK hgroup is the only dubious one. The source of the doubt comes from the fact that it is deprecated by W3C but not by WHATWG, and it is objectively ambiguous (read more at the previous link)

Well, thanks for the clarifications, i guess i will dig further in this hgroup rabbit hole ^^

I guess this issue is sorted, right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

'hgroup' is not a known element error in Angular 5
Acording to MDN. The element has been removed from the HTML5 (W3C) specification, but it still is in the WHATWG version of HTML....
Read more >
<hgroup> - HTML: HyperText Markup Language | MDN
The <hgroup> HTML element represents a heading and related content. ... Attributes. This element only includes the global attributes.
Read more >
[vue warn]: failed to resolve component: router-view if this is a ...
I'm trying to figure out why on earth I can load my component through router-view but not by calling the component itself.
Read more >
4.4 Sections — HTML5 - W3C
The document.body IDL attribute provides scripts with easy access to a document's body element. Some DOM operations (for example, parts of the drag ......
Read more >
HTML Standard
The latter requirement in particular required that the scope of the HTML5 ... hgroup; i; iframe; img; input (if the type attribute is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found