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

Fatal error on 404 - problem with Throw error #7810

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

Fatal error on 404 - problem with Throw error #7810

Ohyenno opened this issue Aug 26, 2022 · 1 comment

Comments

@Ohyenno
Copy link

Ohyenno commented Aug 26, 2022

Describe the bug

+page.ts has a load function with a fetch request

If the request status 404 -> it throws error 404
Thats works well

But if the user goes to another page from the menu and clicks on this page again svelte kit fetch in browser, istead of ssr
Throw error method is not supported in the browser, and everything returns an error of 500

Router is switched to false

Important note: if page throws error (404) the router switches to true then no page is reloaded again until refresh in the browser

Reproduction

console.log(await response.status); // return code server 404, but after using the navigation - return 404 in browser console
if(await response.status !== 200){
throw error (response.status);
}

Logs

client.js:362 <Error> was created with unknown prop 'data'
client.js:362 <Error> was created with unknown prop 'errors'

System Info

@sveltejs/kit@1.0.0-next.442

Severity

blocking all usage of svelte

@Ohyenno Ohyenno changed the title Fatal error on 404 - problem with throws error Fatal error on 404 - problem with Throw error Aug 26, 2022
@Conduitry
Copy link
Member

Duplicate of sveltejs/kit#5952

@Conduitry Conduitry marked this as a duplicate of sveltejs/kit#5952 Aug 26, 2022
@Conduitry Conduitry closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2022
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