Results 87 comments of Simon Green

Possibly related ... importing some server-only package from `src/hooks.server.ts` builds and runs fine: ```ts import { Datastore } from '@google-cloud/datastore' export const datastore = new Datastore() export async function handle({...

Summary: using `$env`, or trying to use modules in any way to arrange hooks (e.g. using sequence) results in these dev or build errors. The only thing that works is...

Still getting this, but discovered if I add an empty `src/hooks.client/index.ts` it fixes the error and allows me to keep the `src/hooks.server` folder

The issue is that the search for shared "hooks" finds and matches the "hooks.server" folder, which is then imported into the client-side code, causing errors. Reproduction here: https://www.sveltelab.dev/egkmtnbmy05petz I think...

Ah, I was wondering what I must be missing Adding something to force it to be a module might be confusing, although it may still help, e.g.: ```ts // See...

It would be a shame to simply preclude the use of two useful features within the same app. From what I can tell, the dynamic public env values are embedded...

No, this is *NOT* about the static adapter. AFAIK it can only ever use static values. This is about the combination of adapter-node (or potentially any adapter with SSR support)...

I'm pretty sure it can be fixed. Don't put the env values in the HTML, put them in the JS (that is loaded anyway). Any JS module using the values...

It's not _really_ whether there should be a pre-render option or not, I don't think there is any case to be made for it - unless the app is built...

The console shows the issue and solution: > Avoid using `history.pushState(...)` and `history.replaceState(...)` as these will conflict with SvelteKit's router. Use the `pushState` and `replaceState` imports from `$app/navigation` instead. With...