Closed mathieutu closed 5 years ago
Don't use words like sometimes. You should tell us how.
If the situation you mentioned only occurs after modifying config.js
, then this is a known issue.
@Shigma It's why it was actually emphasized, and why there is a mention:
It don't know how to reproduce the bug and find a proper pattern for that.
It was on purpose to tell you that I have no idea of the why or how. But now you told me that it can be after updating config.js
, I will pay attention of that, and will be able to confirm it to you.
😉
A new component added in theme/layouts
will not trigger reloading so your new layout will not be available, and you need to watch it by yourself or re-launch your dev server.
In my case, the issue was simply a hanging comma in the config file. Very strange.
I still can have the issue in Vuepress v1.9.7. I even tried the Vuepress docs codebase and same problem.
[Vue warn]: Unknown custom element: <v-7324b362> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
@bill-dou have you gotten some help on this?
@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)
}
}
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.
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.