-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
optimise builds for hash router apps #13217
Comments
Hey, @Rich-Harris Sveltekit throws an error on build when using hash router and setting in +layout.ts export const ssr = false; node:internal/event_target:1094
process.nextTick(() => { throw err; });
^
Error: Page options are ignored when `router.type === 'hash'` (src/routes/+layout.ts has 'ssr')
at analyse (file:///home/nixos/Projects/bobr/tg_quiz_mini_app/client/node_modules/@sveltejs/kit/src/core/postbuild/analyse.js:81:11)
at async MessagePort.<anonymous> (file:///home/nixos/Projects/bobr/tg_quiz_mini_app/client/node_modules/@sveltejs/kit/src/utils/fork.js:23:16)
Emitted 'error' event on Worker instance at:
at [kOnErrorMessage] (node:internal/worker:326:10)
at [kOnMessage] (node:internal/worker:337:37)
at MessagePort.<anonymous> (node:internal/worker:232:57)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)
at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
Node.js v20.17.0
It makes sense we do not need to set the ssr to false since the hash type of the sveltekit router will do it automatically for us. Should I create another issue regarding this? |
It was decided that users should use the real search params: |
I am producing a PWA, so I think I want SSR = false. I want to use hash-based routing since I will be publishing multiple copies of the PWA (based on content in hundreds of minority languages -- each with its own PWA). If I use hash-based routing, is SSR assumed? I have to remove
Shouldn't there be a configuration-based way to specify this (in svelte.config.js)? Update: I just found in the docs.
|
This feels weird. Old 🔥
https://ui.home.arpa/spaces/019400fb-6162-71d8-9d7c-e4ee053c8a32/accounts?type=liability&groupBy=tags
New 😅
https://ui.home.arpa/?type=liability&groupBy=tags#/spaces/019400fb-6162-71d8-9d7c-e4ee053c8a32/accounts I use goto( `${resolveRoute(`/?${this.query.toString()}#/(app)/spaces/[id]`, { id: spaceId.current })}/accounts`, {
replaceState: true,
keepFocus: true,
}
); Wouldn't it have been better to add special handling when in hash mode so we didn't have to refactor when moving between hash and standard routing? That way it would have worked in both modes seamlessly. Even if my URL was ugly before due to uuid it still had meaning but now it looses that and feels different from all other URLs on internet. I think both prepended ?query and appended query should work. I can of course handle it on my own but this is precisely why I use frameworks. |
Describe the problem
If
router.type === 'hash'
we don't need to create a server manifest or bundle routes etcThe text was updated successfully, but these errors were encountered: