Skip to content

Route params is empty if page not found (404) #6453

@bjon

Description

@bjon

Describe the bug

We have a setup like this: /[lang]/path1, /[lang]/path2, etc...

In layout.ts we get the lang from params, so we can fetch other stuff.
But when a page is not found, params is now an empty object.
This broke in v432 (#6174)

Reproduction

  • npm create svelte@latest repro-6453
  • create route src/routes/[test]
  • move +page into src/routes/[test]
  • add +layout.ts to src/routes
/** @type {import('./$types').LayoutLoad} */
export function load({ params }) {
  console.info("params", params);
}

Logs

No response

System Info

System:
    OS: Linux 5.10 Ubuntu 20.04.5 LTS (Focal Fossa)
    CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
    Memory: 12.22 GB / 15.59 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 16.17.0 - /usr/bin/node
    npm: 8.15.0 - /usr/bin/npm

Severity

blocking an upgrade

Additional Information

No response

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