Skip to content

Invalidate doesn't trigger root +layout.server load when on the root page #6269

@CaptainCodeman

Description

@CaptainCodeman

Describe the bug

Calling await invalidate() triggers a fetch of /__data.json on any page except the root.

Reproduction

.

Logs

No response

System Info

System:
    OS: macOS 12.5.1
    CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
    Memory: 1.89 GB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.0 - /usr/local/bin/node
    npm: 8.3.1 - /usr/local/bin/npm
  Browsers:
    Brave Browser: 102.1.39.111
    Chrome: 104.0.5112.101
    Chrome Canary: 107.0.5260.0
    Firefox: 103.0.2
    Safari: 15.6.1
    Safari Technology Preview: 16.0
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.66 
    @sveltejs/adapter-node: next => 1.0.0-next.87 
    @sveltejs/kit: next => 1.0.0-next.437 
    svelte: ^3.49.0 => 3.49.0 
    vite: ^3.0.9 => 3.0.9

Severity

blocking an upgrade

Additional Information

I don't know if it is specific to the root route, or might be "on the same route as the layout"
I don't know if it also affects +page.server.ts load functions

I'm not using any layout groups, just plain /+layout.server.ts at the root.

Example of the issue: changing the drop-down posts to the server and calls invalidate(). The data only re-loads when not on the homepage.

Screen.Recording.2022-08-25.at.9.22.31.AM.mov

NOTE: The /__data.json that is requested when the route changes, does not contain any data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions