W
Wasp-lang17mo ago
jtawf

using client-side env variables

I'm using .env.client however i'm told process is undefined and the documentation provides no reference to this, how can I resolve this? @Wasp Team
14 Replies
miho
miho17mo ago
@jtawf that's actually a bug we discovered today + we are updating the docs as we speak
jtawf
jtawfOP17mo ago
ok thanks!
miho
miho17mo ago
Link to stage docs
miho
miho17mo ago
Env Variables | Wasp
Environment variables are used to configure projects based on the context in which they run. This allows them to exhibit different behaviors in different environments, such as development, staging, or production.
miho
miho17mo ago
1️⃣ import.meta.env is how you want access the env variables since we are using Vite 2️⃣ I'll ping you tomorrow when we release a version with the bug fix for .env.client 😊
jtawf
jtawfOP17mo ago
thanks @miho, do i have to change the module flag as mentioned (The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'.) or will the fix include that?
miho
miho17mo ago
It should already work out of the box 🤔 did you modify the tsconfig.json by any chance?
jtawf
jtawfOP17mo ago
for some reason it doesn't, i never modified ts.config either when i added the module flag it threw different errors about not being able to find other modules like react or @wasp/types Error Message: Cannot find module '@wasp/entities'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option? Cannot find module 'react'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option? Cannot find module '@aws-sdk/client-s3'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
miho
miho17mo ago
@soda09802 if you could take a look tomorrow
HufflePuffDaddy
HufflePuffDaddy17mo ago
ya we're getting burned by this too
miho
miho17mo ago
@jtawf the fix for .env.client is out now 🙂 curl -sSL https://get.wasp-lang.dev/installer.sh | sh to update
martinsos
martinsos16mo ago
@jtawf and @HufflePuffDaddy did this solve the problem for you?
HufflePuffDaddy
HufflePuffDaddy16mo ago
Yes I'm set on this one
martinsos
martinsos16mo ago
Awesome!
Want results from more Discord servers?
Add your server