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

error and fallback pages for init() hook #13333

Open
lumosminima opened this issue Jan 17, 2025 · 0 comments
Open

error and fallback pages for init() hook #13333

lumosminima opened this issue Jan 17, 2025 · 0 comments
Labels
feature / enhancement New feature or request

Comments

@lumosminima
Copy link

Describe the problem

I need to fetch my db before any single bit of my SvelteKit SPA can load, I currently use init() insidie hooks.client.ts but errors invoked using kit's error() aren't presented in either +error.svelte or error.html

Describe the proposed solution

I would like an optional fallback (while init() is awaited) and error page (when init() throws), ideally with our css files loaded (for styling). Currently, if there is an error a white screen is presented with no indication of what went wrong which is confusing to users.

Alternatives considered

Use root layouts for initial stuff but in my experience this has been clunky for init() stuff that needs to load once and requires extra conditional logic and I need separation of concerns. If there are other ways that I can handle this that I haven't considered or am not aware of do share!

Importance

would make my life easier

Additional Information

Router Mode: #hash
Adapter adapter-static

@eltigerchino eltigerchino added the feature / enhancement New feature or request label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature / enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants