Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected Error Status Code #6319

Closed
alialaa opened this issue Aug 26, 2022 · 1 comment
Closed

Unexpected Error Status Code #6319

alialaa opened this issue Aug 26, 2022 · 1 comment

Comments

@alialaa
Copy link

alialaa commented Aug 26, 2022

Describe the bug

I am trying to throw an error in a page's +page.js file. In this simple example I am using the status code returned from an API which in this example should be 404. In +error.svelte I am displaying the error status using $page.status which works fine when you first load the page; but always returns 500 when you navigate from and then back to the page. $page.error.status works consistently though.

I am not sure if that's a bug or $page.status is different than $page.error.status for some reason?

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-bdr4bj?file=src/routes/+error.svelte

Logs

No response

System Info

System:
    OS: macOS 12.1
    CPU: (8) arm64 Apple M1
    Memory: 74.94 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.16.0 - /usr/local/bin/node
    Yarn: 1.22.11 - ~/.npm-global/bin/yarn
    npm: 8.11.0 - /usr/local/bin/npm
    Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 104.0.5112.101
    Safari: 15.2
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.66 
    @sveltejs/kit: ^1.0.0-next.423 => 1.0.0-next.443 
    svelte: ^3.44.0 => 3.49.0 
    vite: ^3.0.0 => 3.0.9

Severity

annoyance

Additional Information

No response

@Rich-Harris
Copy link
Member

This is a duplicate of #5952

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants