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

Custom 404 page with custom theme - Cannot resolve Layout.vue file in .vuepress/theme #1178

Closed
1 task done
deraw opened this issue Jan 9, 2019 · 4 comments
Closed
1 task done

Comments

@deraw
Copy link
Contributor

deraw commented Jan 9, 2019

  • I confirm that this is a issue rather than a question.

Bug report

Version ^0.14.5

Steps to reproduce

Create a 404.vue page in a Vuepress repo located in .vuepress/theme/layouts/.

What is expected?

The layout should be used when rendering a not found page.

What is actually happening?

The default layout is used.

Other relevant information

In the documentation, it's specified that we can create a local theme. After, it's said that we can have a 404.vue page in layouts folder. But Vuepress just don't use it.
It's even worse if I put the Layout.vue in /layouts, I get the folowwing error: Error: [vuepress] Cannot resolve Layout.vue file in .vuepress/theme.

Is there a workaround? How do I customize the 404 page?

  • Your OS:
  • Node.js version:
  • Browser version:
  • Is this a global or local install?
  • Which package manager did you use for the install?
@deraw
Copy link
Contributor Author

deraw commented Jan 10, 2019

Solution: create a NotFound.vue component alongside Layout.vue.

@deraw deraw closed this as completed Jan 10, 2019
@avxkim
Copy link

avxkim commented Feb 9, 2019

Vuepress documentation is inconsistent, it says that we could put our theme in .vuepress/theme/layouts/Layouts.vue, but we can't because it throws an error during a build: Error: [vuepress] Cannot resolve Layout.vue file in .vuepress/theme.

@deraw
Copy link
Contributor Author

deraw commented Feb 9, 2019

@heihachi88 I think that's because you're looking at the documentation for 1.0 (https://vuepress.vuejs.org/), but using 0.x (https://v0.vuepress.vuejs.org/), just like I did!

@ulivz
Copy link
Member

ulivz commented Feb 9, 2019

@heihachi88 As @Deraw- said, you are reading the docs of 1.x but installed 0.x.

image

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

3 participants