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

Created on 9 Jan 2019  路  4Comments  路  Source: vuejs/vuepress




  • [x] 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?

Most helpful comment

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

image

All 4 comments

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

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.

@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!

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

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

genedronek picture genedronek  路  3Comments

shaodahong picture shaodahong  路  3Comments

lileiseven picture lileiseven  路  3Comments

kid1412621 picture kid1412621  路  3Comments

sankincn picture sankincn  路  3Comments