Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Error in async preload breaks SSR #494

Closed
mrkishi opened this issue Oct 25, 2018 · 6 comments
Closed

Error in async preload breaks SSR #494

mrkishi opened this issue Oct 25, 2018 · 6 comments
Labels

Comments

@mrkishi
Copy link
Member

mrkishi commented Oct 25, 2018

The server never responds to page routes (server routes work) requests when the preload function fails. It just hangs there until timeout.

@Rich-Harris
Copy link
Member

Can you give an example? If I throw an error inside preload (async or not) it behaves as expected for me, for both client and server rendering.

@mrkishi
Copy link
Member Author

mrkishi commented Oct 27, 2018

Sorry for not including a lot of information. I intended to look further into it when I had time.

Maybe it's not related to async but to layout's preload? For now, here's an example in action: mrkishi/sapper-template@01be2b1.

@mrkishi
Copy link
Member Author

mrkishi commented Oct 27, 2018

Okay, so it's not just async. Any throws inside a common layout preload will also make the server hang. That's because it enters an infinite loop trying to render the error: handle_error calls handle_page calls handle_error... We probably want to answer to errors when handling an error with a simple 500 error?

@jarrodldavis
Copy link
Contributor

@mrkishi and I talked about this in the Discord and agreed that it would be good to have some indication of the _error page being rendered when calling preload.

@Conduitry
Copy link
Member

How much of this is still an issue? It looks like #677 should have fixed the infinite preload error.

@mrkishi
Copy link
Member Author

mrkishi commented Jun 11, 2019

This can indeed be closed!

I'll open an issue about providing a better error solution when a page's hitting errors on handle_error, though, since we're currently just preing Internal server error which isn't really ideal.

@mrkishi mrkishi closed this as completed Jun 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants