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.

Unknown custom element for Layout

See original GitHub issue
  • I confirm that this is an issue rather than a question.

Bug report

Version

v1.0.0-alpha.44

Steps to reproduce

What is expected?

A new component in theme/layouts directory should be available as layout.

What is actually happening?

Sometimes when navigating through the app, a page is not loaded, and an “Unknown custom element” error is thrown.

It can be a custom layout or not.

The page is ok if I refresh it.

It don’t know how to reproduce the bug and find a proper pattern for that.

[Vue warn]: Unknown custom element: <Tag> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <GlobalLayout> at node_modules/@vuepress/core/lib/client/components/GlobalLayout.vue
       <Root>
[Vue warn]: Unknown custom element: <v-b2bf5494> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <Content>
       <Page> at node_modules/@vuepress/theme-default/components/Page.vue
         <ParentLayout> at node_modules/@vuepress/theme-default/layouts/Layout.vue
           <Layout> at .vuepress/theme/layouts/Layout.vue
             <GlobalLayout> at node_modules/@vuepress/core/lib/client/components/GlobalLayout.vue
               <Root>

---> <GlobalLayout> at node_modules/@vuepress/core/lib/client/components/GlobalLayout.vue
       <Root>
[Vue warn]: Unknown custom element: <Post> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <GlobalLayout> at node_modules/@vuepress/core/lib/client/components/GlobalLayout.vue
       <Root>

Other relevant information

I’m using the blog plugin, and it adds some layout automatically to pages.

All my Layout components have a name key.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jessemarplecommented, Jun 25, 2019

In my case, the issue was simply a hanging comma in the config file. Very strange.

0reactions
bill-doucommented, Dec 2, 2022

@krofax yes, I got a solution.

EnhanceApp.js

import pageComponents from '@internal/page-components'

export default ({ Vue }) => {
  for (const [name, component] of Object.entries(pageComponents)) {
    Vue.component(name, component)
  }
}

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Solve "Unknown Custom Element" in Vue
Don't worry, I'll show you exactly how to fix this. You need to make sure that your component is being properly registered. But...
Read more >
Unknown custom element element in Vue for a widget non ...
This widget is essentially a third-party element which works properly. However, I am getting this: [Vue warn]: Unknown custom element: <example- ...
Read more >
[Vue warn]: Unknown custom element: - did you register the c
Topic: [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the \"name\" option....
Read more >
[Vue warn]: Unknown custom element: <example-component>
it looks like mix is either not compiling my app.js file or im loading the wrong js film from blade master layout.
Read more >
Solution to Vue.js Error - Unknown custom element - did you ...
Unknown custom element: <Categories> - did you register the component correctly? For recursive components, make sure to provide the "name" ...
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