Replies: 1 comment 1 reply
-
In the main process, also use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For example I have a
src/utils/supabase.ts
file that can be called by bothApp.svelte
andsrc/main/index.ts
:I'm not sure I understood this correctly https://electron-vite.org/config/#environment-variables, but I've forwarded the variables over to the processes, even though they're
VITE_
prefixed.I've created two
.env.production
and.env.development.local
files. While if I useprocess.env.VITE_SUPABASE_URL
in the main process for example, it has no issues accessing it.However the supabase util function throws error when trying to reach
process.env
when it's called by the main process.What am I doing wrong? How to set variables properly so that they're accessible by client & processes simultaneously?
Making sort of a “proxy” for
VITE_SUPABASE_URL: JSON.stringify(env.VITE_SUPABASE_URL),
like'process.env.VITE_SUPABASE_URL': JSON.stringify(env.VITE_SUPABASE_URL)
makes it work I guess, but feels like I'm reinventing the wheel.Beta Was this translation helpful? Give feedback.
All reactions