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

How to build/export $error.svelte / 404 page with adapter-static ? #1172

Closed
gevera opened this issue Apr 22, 2021 · 5 comments
Closed

How to build/export $error.svelte / 404 page with adapter-static ? #1172

gevera opened this issue Apr 22, 2021 · 5 comments

Comments

@gevera
Copy link

gevera commented Apr 22, 2021

After running npm run build with adapter-static I hoped that the $error.svelte page would be generated as well. When statically hosted and whenever a non-existent route is hit, Sveltkit would redirect to the 404.html page.

With Sapper we just added to package.json a couple of lines

"build:export": "sapper export --entry \"/ /404\"",
"postexport": "mv __sapper__/export/404/index.html __sapper__/export/404.html"

I wonder how it is done with Sveltekit. Thanks

@benmccann
Copy link
Member

This is highly related to #754 and possibly a duplicate of that issue

@gevera
Copy link
Author

gevera commented Apr 23, 2021

This is highly related to #754 and possibly a duplicate of that issue

Thanks for pointing it out. I believe it is a duplicate indeed. Hopefully, the fallback feature will be implemented soon.

@intrikate
Copy link

intrikate commented Apr 23, 2021

And what about /404 for non-SPA? Unless I misunderstand it completely, providing a fallback will disable SSR, whereas Sapper would simply render and write an additional page. Can the latter somehow be replicated?

@gevera
Copy link
Author

gevera commented Apr 24, 2021

And what about /404 for non-SPA? Unless I misunderstand it completely, providing a fallback will disable SSR, whereas Sapper would simply render and write an additional page. Can the latter somehow be replicated?

This is a good question. After yesterday release of "@sveltejs/adapter-node": "next" and reading the docs, I came to a conclusion that this is not a viable solution for SSR where a simple one extra 404.html page is needed. Is there a way we could reopen this bug?

@benmccann
Copy link
Member

I think it'd be better to file a new issue about that

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

No branches or pull requests

3 participants