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

Error page custom layout not being always respected and loaded. #7658

Closed
axeldomingues opened this issue Jul 2, 2020 · 7 comments · Fixed by #8016
Closed

Error page custom layout not being always respected and loaded. #7658

axeldomingues opened this issue Jul 2, 2020 · 7 comments · Fixed by #8016
Assignees

Comments

@axeldomingues
Copy link

Versions

  • nuxt: 2.13.2
  • node: 10.16.0

Reproduction

Additional Details
https://codesandbox.io/s/nuxt-error-layout-not-change-7z60q?file=/pages/index.vue

Steps to reproduce

https://codesandbox.io/s/nuxt-error-layout-not-change-7z60q?file=/pages/index.vue

You can use the sandbox above and you will quickly understand and reproduce the issue even setting the lastest version of nuxt. You will be able to reproduce the case where the error page custom layout is not respected.

What is Expected?

As mentioned in the documentation and as in previous versions we should be able to set a custom layout for the error page.

What is actually happening?

Unfortunately, this has stopped working in the last version and it seems that it was not working on version 2.12.0 too.

@Atinux
Copy link
Member

Atinux commented Jul 3, 2020

We released 2.13.3 that should fix your issue. Please try again and confirm that it's fixed please.

@Atinux Atinux self-assigned this Jul 3, 2020
@barfi
Copy link

barfi commented Jul 3, 2020

Nuxt v. 2.13.3 same issue. Error page with custom layout option works only for requests where error handled on the server side. After that all is fine, client routing works as expected. In other cases error page uses default layout =\

@axeldomingues
Copy link
Author

Yes, I can confirm what @barfi said is the reality. It is not working as expected even in 2.13.3.

@Feaman
Copy link

Feaman commented Jul 12, 2020

Spent many hours on this. As I could undestand, if an error occures outside the default layout (for example, 404 error), so there is no current page to use some layout, then error page uses it's own layout (set in the error component layout: 'blog'). But when an error rises from the some defined page (with default layout), then error page uses this default layout, not it's own one.

@hastedev
Copy link

hastedev commented Aug 6, 2020

I am having a similar issue where I will trigger the error page by any means and then any route navigated to after that has its layout overridden by the error pages current set layout. Not sure if 100% related though.

For example:

  • error "layout" uses a layout called "layoutforerrors"
  • home page uses a layout called "home"
  • go to home page -> error page -> home page
  • home page will then still be using "layoutforerrors" and the layout will not switch back

@Kolobok12309
Copy link
Contributor

Kolobok12309 commented Sep 2, 2020

+1 for this issue
2.14.4 same issue
https://codesandbox.io/s/nuxt-error-layout-not-change-wzmvf

@pi0
Copy link
Member

pi0 commented Sep 10, 2020

Should be resolved with v2.14.5

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

Successfully merging a pull request may close this issue.

8 participants