Skip to content
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

[Vue warn]: Unknown custom element: <Layout> in pagination-plugin #935

Closed
taoxinyi opened this issue Oct 15, 2018 · 3 comments
Closed

[Vue warn]: Unknown custom element: <Layout> in pagination-plugin #935

taoxinyi opened this issue Oct 15, 2018 · 3 comments

Comments

@taoxinyi
Copy link

taoxinyi commented Oct 15, 2018

Bug report

Version

vuepress@1.0.0-alpha.9
@vuepress/plugin-pagination@1.0.0-alpha.10

Steps to reproduce

repo
In config.js of .vuepress

['@vuepress/pagination', {
            paginationDir: 'blog/page',
            firstPagePath: '/blog/',
            perPagePosts : 1
}]]

Then I modify index.js in pagination-plugin to see whether it actually works.

console.log(pagination.paginationPages)

then I get

[ { path: '/blog/', interval: [ 0, 0 ] },
  { path: '/blog/page/2/', interval: [ 1, 1 ] } ]

Then I goto /blog/page/2/ I got this error:

vue.runtime.esm.js?2b0e:587 [Vue warn]: Unknown custom element: <Layout> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <Layout> at node_modules/@vuepress/theme-default/layouts/Layout.vue
       <LayoutDistributor> at node_modules/@vuepress/core/lib/app/components/LayoutDistributor.vue
         <Root>

If I change the layout parameter to one of my own component in .vuepress/components, It can work, but the global theme is lost.

By the way, if layout does use the default parameter Layout, what is the .md file the page based on to render the html?

What is expected?

No error when go to /blog/page/2/

What is actually happening?

[Vue warn]: Unknown custom element: in pagination-plugin when go to /blog/page/2/

Other relevant information

  • Your OS: Win10
  • Node.js version: 9.3.0
  • Browser version:
  • Is this a global or local install? local
  • Which package manager did you use for the install? npm
@ulivz
Copy link
Member

ulivz commented Oct 15, 2018

Could you provide your reproduction repo?

@taoxinyi
Copy link
Author

https://github.com/AntiSomnus/vuepress-test
In this repo I can't go to /blog/page/2/,
if I set layout to one of my component, It could work, but I don't know how to maintain the theme in my custom component.

@ulivz ulivz closed this as completed in 1f345d1 Oct 17, 2018
@ulivz
Copy link
Member

ulivz commented Oct 17, 2018

This is due to we don't remove the legacy code of custom layout. fixed at 1f345d1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants