Skip to content

Prefetch repeatedly refetching after a 40x from a route #8301

@Curstantine

Description

@Curstantine

Describe the bug

SvelteKit repeatedly tries to prefetch a page that throws 40x http codes.
Which should not be the case for 401 and 403, as they are typically used for restricting access to content.

This also adds the issue of hooks.server.ts being spammed with each request.

Reproduction

https://github.com/Curstantine/sveltekit-prefetch-4xx-repeat

Logs

No response

System Info

System:
    OS: Linux 6.0 undefined
    CPU: (4) x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
    Memory: 4.82 GB / 7.65 GB
    Container: Yes
    Shell: 3.5.1 - /bin/fish
  Binaries:
    Node: 19.3.0 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 8.19.2 - /usr/bin/npm
  npmPackages:
    @sveltejs/adapter-auto: ^1.0.0 => 1.0.0 
    @sveltejs/kit: ^1.0.0 => 1.0.1 
    svelte: ^3.54.0 => 3.55.0 
    vite: ^4.0.0 => 4.0.3

Severity

annoyance

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