Skip to content

Layout invalidated when referencing missing search param #10504

Closed as not planned
@coryvirok

Description

@coryvirok

Describe the bug

I have a layout that loads some data based on a search param. If the search param is not provided, I expect the layout to not be re-run on navigation to child routes. However, it appears that the layout will be re-run on every child route change, despite the search param never being provided.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-dkhony?file=src%2Froutes%2F%2Blayout.server.js

Logs

No response

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.20.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.6.10 - /usr/local/bin/pnpm
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.1.0 
    @sveltejs/kit: ^1.20.4 => 1.22.4 
    svelte: ^4.0.5 => 4.1.2 
    vite: ^4.4.2 => 4.4.9

Severity

blocking an upgrade

Additional Information

Something else to note is that I'm using a wildcard route.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions