| 21 Dec 2023 |
Lily Foster | (if i'm reading this doc right) | 16:06:52 |
peter-lustig | read what is ent | 16:07:06 |
peter-lustig | when i use dynamic i get an error | 16:07:11 |
peter-lustig | that i shoul duse static | 16:07:15 |
peter-lustig | because of the prerendering | 16:07:20 |
Lily Foster | oh, so you need real values during build time then? | 16:07:30 |
Lily Foster | that would be secrets baked in to your program :grimc | 16:07:38 |
Lily Foster | * that would be secrets baked in to your program 😬 | 16:07:45 |
Lily Foster | do they have a better way to deal with secrets? | 16:08:03 |
peter-lustig | i will first test the fake values now | 16:08:03 |
peter-lustig | because what i really wonder is why npm run build works and nix build errors out | 16:08:14 |
Lily Foster | i mean again, the fake values will let it build, but if it's baking them in, it won't work. you could put real values in there but then you'd have world-readable secrets | 16:08:26 |
Lily Foster | In reply to @peter-lustig:matrix.org because what i really wonder is why npm run build works and nix build errors out there is no npm/nix difference here. the difference is you are baking in variables that you are making available in your local env but not in your build env | 16:08:51 |
Lily Foster | In reply to @peter-lustig:matrix.org because what i really wonder is why npm run build works and nix build errors out * there is no npm/nix difference here. the difference is you are baking in variables that you are making available in your local env but not in your nix build env | 16:08:55 |
Lily Foster | from what i can tell anyway | 16:09:10 |
peter-lustig | In reply to @lily:lily.flowers i mean again, the fake values will let it build, but if it's baking them in, it won't work. you could put real values in there but then you'd have world-readable secrets for runtime i am passing the env variables via dotenv and command line arguments with agenix, so to be honest I just need to have it building | 16:09:11 |
peter-lustig | lemme try the fake values | 16:09:26 |
Lily Foster | In reply to @peter-lustig:matrix.org for runtime i am passing the env variables via dotenv and command line arguments with agenix, so to be honest I just need to have it building yeah but svelte explicitly says the values are baked in at build time. how would it be grabbing them at runtime if you don't have other code to do such? | 16:09:46 |
Lily Foster |
If the user lands on a prerendered page, SvelteKit will request up-to-date values for $env/dynamic/public from the server (by default from a module called _env.js ...)
| 16:10:14 |
Lily Foster | ah | 16:10:15 |
Lily Foster | that sounds .... weird. but that does mean fake values might work? | 16:10:26 |
peter-lustig | I will try now xd | 16:10:37 |
Lily Foster | i do hope it is that simple! | 16:11:21 |
Lily Foster | not sure how many variables you have in the file, but you will likely need to define all of them | 16:11:46 |
Lily Foster | i wonder why svelte doesn't have a way to say "this won't be needed at build time, just put a blank value in" | 16:12:02 |
peter-lustig | just four | 16:12:08 |
peter-lustig | In reply to @lily:lily.flowers i wonder why svelte doesn't have a way to say "this won't be needed at build time, just put a blank value in" idk maybe they do but not many people use sveltekit compared to react for example so finding stuff out is usually difficult | 16:12:34 |
Lily Foster | In reply to @peter-lustig:matrix.org idk maybe they do but not many people use sveltekit compared to react for example so finding stuff out is usually difficult that's pretty fair tbh, i could totally see that | 16:12:53 |
peter-lustig | ok so now the stuff builds | 16:13:05 |
peter-lustig | i guess it would just work now, let me test this in production | 16:13:13 |