question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested layouts are rendering inside parent layouts for error pages

See original GitHub issue

Describe the bug

I have a __layout.svelte (1) in the root of route directory. I have another __layout.svelte (2) more specific in a internal route. So, when I click in a link to a route that not exists yet, the error default error page is renderized in a blank page sometimes, or in the <slot> of __layout.svelte (2) in another times. But, if after that I click in a link to a valid route, the new page is renderized in a new <slot>, as if it were being rendered in the slot (1) , but still maintaining the rendering of slot (2), rendering twice .

Logs

Don’t have server logs for that. There is no significant log in console.

To Reproduce

image image image

  "devDependencies": {
    "@sveltejs/adapter-node": "^1.0.0-next.20",
    "@sveltejs/kit": "next",
    "eslint": "^7.27.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-svelte3": "^3.2.0",
    "prettier": "~2.3.0",
    "prettier-plugin-svelte": "^2.3.0",
    "svelte": "^3.38.2",
    "svelte-windicss-preprocess": "^4.0.7",
    "windicss": "^3.0.12"
  },

Expected behavior I click in a link. The page not exist. The error page is renderized. I click in a new link, to a page that exists. The page is new renderized.

Information about your SvelteKit Installation:

Diagnostics
System:
    OS: Linux 5.8 Linux Mint 20.1 (Ulyssa)
    CPU: (4) x64 Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
    Memory: 12.14 GB / 23.38 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 16.2.0 - ~/.nvm/versions/node/v16.2.0/bin/node
    npm: 7.13.0 - ~/.nvm/versions/node/v16.2.0/bin/npm
  Browsers:
    Chrome: 91.0.4472.77
    Chromium: 90.0.4430.212
    Firefox: 88.0.1
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.107 
    svelte: ^3.38.2 => 3.38.2 
  • Your browser Firefox 88.0.1 (64-bits) (For Linux Mint 20.1)

  • Your adapter (e.g. Node, static, Vercel, Begin, etc…) Node

Severity How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of SvelteKit entirely? Blocking your usage of SvelteKit entirely. Only if the client refresh the page, the problem is solved.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
maxicarlos08commented, Oct 30, 2021

The current behaviour of rendering root __error page for 404s (instead of nested __error if present) seems to be intended.

But why? I am having similar issues and it is quite annoying

1reaction
moisesbitescommented, Apr 5, 2022

If it’s not possible to reproduce, then can this issue be closed?

OK. I close. If it happens again, I can open a new issue by referencing this one. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

is this a defect? cannot define section when using nested ...
'render' an optional section in a parent layout; reference the parent layout from a child layout; reference the child layout from a view ......
Read more >
Nested layout inside application layout - Stack Overflow
On my site I need to make one separate part of the site only for administrator. I have this in my application.html.erb file:...
Read more >
Easier Nested Layouts in Rails | mattbrictson.com
Rails offers a basic solution for this in the form of layout ... The nested layout has to trigger its parent layout with...
Read more >
Nested layouts - Blazor University
Not only do pages descend from this class, but the LayoutComponentBase does too! This means that a custom layout can also have its...
Read more >
Performance and view hierarchies - Android Developers
This page describes how to assess whether your view hierarchy is ... Android Layouts allow you to nest UI objects in the view...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found