-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown Custom Element - <v-#####> #1173
Comments
Hi @bretterer, |
@cietho same issue. I am getting the correct |
@ulivz @yyx990803 Trying to get some attention on this. It seems to have regressed into a broken version of being able to use This is preventing a major part of our new site being built. Any way to get some attention to this bug? I am not sure if this was caused by the changes inside of VuePress, or if this is actually vue.js related. |
Suggest to test in the newest version and update the issue.
|
@bretterer If you want others to help you, please follow the issue guidelines, and create a minimal and valid repro repo since it's so large for me to clone. |
I found a similar issue related to this. The cause is that we do not register all the
So if you are using |
Reproduction Repo added. https://github.com/bretterer/VuePress-bug-1173 Just run the |
@bretterer This will be fixed if #1402 is merged |
I just stumble upon the same issue. I'm running version 1.0.0-alpha.42. As a consequence, the links from sidebar doesn't load the page. It appears only after the page is refreshed. Any quick fix I can make? |
A quick fix for this issue in import pageComponents from '@internal/page-components'
export default ({ Vue }) => {
for (const [name, component] of Object.entries(pageComponents)) {
Vue.component(name, component)
}
} This will (I think) fix all similar issues with What's more, all these components are async components, so you might not worry much about the registeration. |
Awesome, that worked as a cham. I figured out that this issue only happens when using custom components. Which this enhancement fixes. Thank you very much! |
This registers all the components into Vue. This ia a temp fix until github.com/vuejs/vuepress/issues/1173 is patched
This registers all the components into Vue. This ia a temp fix until github.com/vuejs/vuepress/issues/1173 is patched
The workaround from @meteorlxy isn't a good idea. The page component should be registered ONLY when they are used, otherwise and you’ll be switched to a new page even if your content of asynchronous page has not been loaded - this experience is too strange, besides, the current state of |
Accurately fixed at 9d01514 and out at 1.0.0-alpha.43. |
Hmm, looks like not really or I'm having different problem with this issue. I'm still getting an error, when I'm using a custom vue component, on index.md, and click to another link: |
Is there any upadate on this issue please? |
Hey, looks like it is solved for me yes with hack from @meteorlxy. Even running the latest alpha version should work fine. |
Same error in 1.0.0-alpha.48 |
… />` in a custom page without markdown (#1699) **Bug**: example, , will raise `[Vue warn]: Unknown custom element`, like #1173 #1426 **Reason**: because it not inject any content in `@internal/page-components` while not find markdown file, `Vue.component` of `pageKey` must be `undefined`, then `h(pageKey)` raise this error **Fix**: judge as `if (Vue.component(pageKey))`, unnecessary to render if no component existed
I'm on 1.2.0 and still experiencing this issue, but the @meteorlxy works for me. I realize it's not ideal, but I don't see another alternative at this point? |
@justin-schroeder Same as me, 1.2.0 and @meteorlxy 's hacking enhanceApp.js working. After dig it, I find that if changing vuepress/packages/@vuepress/core/lib/client/components/Content.js Lines 24 to 26 in 7d6e420
return h(pageKey) -> return h(Vue.component(pageKey)) , all will be fine without the hacking above. Hope that can help some.
|
@justin-schroeder @tianjianchn What about creating a new issue to report / suggest that? Providing a reproduction repo could help a lot. |
Indeed, same here |
same here, 1.2.0 |
In current version, the cause of If anyone still meet with this problem, please open another issue and provide the reproduction steps / repo. |
Bug report
During development, we created a component that went through each
index.md
file in a folder based on thethis.$site.pages.path
list. After upgrading to 1.0.0-alpha.30 to fix a few other issues we were having, It no longer works.Component code:
This results in the following errors.
looking at the Vue plugin for chrome, I can see that the page.key is there.
In the page, I am simply calling
<ChangeLogList />
which invokes the above global-component.Reference Links in repo
Global Component : https://github.com/okta/okta.github.io/blob/VuePress/packages/%40okta/vuepress-theme-default/global-components/ChangeLogList.vue
Component invoking ChangeLogList:https://github.com/okta/okta.github.io/blob/VuePress/packages/%40okta/vuepress-theme-default/components/ChangeLog.vue
Page that is uisng ChangeLog (View Raw): https://github.com/okta/okta.github.io/blob/VuePress/packages/%40okta/vuepress-site/docs/change-log/index.md
Version
1.0.0-alpha.30
Steps to reproduce
See Repo (and branch VuePress) https://github.com/okta/okta.github.io/tree/VuePress
What is expected?
Display inline the content of each changelog file
What is actually happening?
Throwing console errors
Other relevant information
The text was updated successfully, but these errors were encountered: