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

Page throwing 4xx error turns into 500 when client-side-routed #6128

Closed
aradalvand opened this issue Aug 20, 2022 · 1 comment
Closed

Page throwing 4xx error turns into 500 when client-side-routed #6128

aradalvand opened this issue Aug 20, 2022 · 1 comment

Comments

@aradalvand
Copy link
Contributor

aradalvand commented Aug 20, 2022

Describe the bug

If you have a page that does a throw error(403) for example, and you navigate to that page via an <a> tag on the site (i.e. using the client-side router), you'll incorrectly always get a 500 error instead.

Dead-simple repro: https://github.com/aradalvand/sveltekit-error-problem

Reproduction

  1. Run git clone https://github.com/aradalvand/sveltekit-error-problem
  2. Run npm i && npm run dev
  3. Navigate to /foo, you'll get a 403 error, as expected.
  4. Now, navigate to the home page, and click on the "Go to foo" button, now you'll get a 500 error while the page actually threw a 403.

Logs

No response

System Info

System:
    OS: Linux 5.15 Ubuntu 20.04.4 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
    Memory: 236.17 MB / 3.77 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 16.15.1 - /usr/bin/node
    npm: 8.11.0 - /usr/bin/npm
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.65
    @sveltejs/kit: next => 1.0.0-next.428
    svelte: ^3.44.0 => 3.49.0
    vite: ^3.0.4 => 3.0.9

Severity

blocking an upgrade

Additional Information

No response

@aradalvand aradalvand changed the title Page that throws 403 truns into 500 when client-side router is used Page that throws 4xx truns into 500 when client-side router is used Aug 20, 2022
@aradalvand aradalvand changed the title Page that throws 4xx truns into 500 when client-side router is used Page throwing 4xx error turns into 500 when client-side-routed Aug 20, 2022
@Rich-Harris
Copy link
Member

I'm fairly sure this is a duplicate of #5952, so I'm going to close it in favour of that issue

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