Vite build / deployment problem #11272
danielbayley80
started this conversation in
General
Replies: 1 comment 3 replies
-
okay, if in doubt .... read F'in manual .... "SvelteKit will load your +page/layout(.server).js files (and all files they import) for analysis during the build. Any code that should not be executed at this stage must check that building from $app/environment is false:" Most of my app depends on mongodb, so I will likely need to put this build check high up in the stack. What is the implication of svelte not running some / all of your app. Is this mainly a pre-rendering thing? Edit ... it's not clear to me if I should use my dev connection string, or just prevent database code from running. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is likely a noob question, and might be a vite thing or a sveltekit, or my lack of understanding not sure ..... but I haven't been able to GPT my way out of it.
I run "vite build" and everything goes okay. Then it appears to try and run my app (not what I expected) and errors out because there is no production connection string locally.
Is this sveltekit trying to pre-render SSR content? I was just hoping to get a standard vite build output which I push to the server.
What am I missing here?
``
✓ 459 modules transformed.
Environment : production
node:internal/event_target:1037
process.nextTick(() => { throw err; });
^
Error [MongoParseError]: Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"
``
Beta Was this translation helpful? Give feedback.
All reactions