bug: /dashboard gets pre-rendered with hardcoded redirect to /auth
spy16 opened this issue · comments
Shivaprasad Bhat commented
/dashboard
is a private route (under route group (private)
).
(private)
route group has a+layout.ts
withprerender=false
(public)
route group has a+layout.ts
withprerender=true
The home page which is a public route has a a
tag to /dashboard
(part of private group). Due to this, during build, it seems that SvelteKit is preloading /dashboard
and pre-rendering it. The final build has a dashboard.html
file with just this:
<script>location.href="/auth";</script><meta http-equiv="refresh" content="0;url=/auth">
If I remove the <a href="/dashboard">Get Started</a>
from the home-page then, this does not happen and everything works as expected.
Sikandar Bhide commented
Remove :
data-sveltekit-preload-data="hover"
from app.html and add
(private) / dashboard / +page.server.ts
export const prerender = false;
-- add this to +page.server.ts