Env vars broke in `v0.67.3`

Hello, I updated to v0.67.3 and my app broke. In src/newtab/index.tsx I tried console.log('b', process.env.PLASMO_PUBLIC_SUPABASE_URL); but it logs undefined. Downgrading to 0.66.0 works fine though. Additionally verified through
➜ npm run build && printenv | grep "PLASMO_PUBLIC_SUPABASE_URL"

> build
> plasmo build --no-hoist --source-maps

🟣 Plasmo v0.67.3
πŸ”΄ The Browser Extension Framework
πŸ”΅ INFO | Prepare to bundle the extension...
πŸ”΅ INFO | Loaded environment variables from: []
🟒 DONE | Finished in 1778ms!
PLASMO_PUBLIC_SUPABASE_URL=http://localhost:54321
➜ npm run build && printenv | grep "PLASMO_PUBLIC_SUPABASE_URL"

> build
> plasmo build --no-hoist --source-maps

🟣 Plasmo v0.67.3
πŸ”΄ The Browser Extension Framework
πŸ”΅ INFO | Prepare to bundle the extension...
πŸ”΅ INFO | Loaded environment variables from: []
🟒 DONE | Finished in 1778ms!
PLASMO_PUBLIC_SUPABASE_URL=http://localhost:54321
(The env var is set via direnv, i'm not using a .env.local file Anyone able to reproduce? Should I create a GH issue?
4 Replies
lab
labβ€’2y ago
I think this should be filed as an RFC - the original env behavior was only consisting of .env files, and no system env should be consumed. For this RFC we will parse through the system env for any PLASMO_PUBLIC_ env as well. 0.67.0 closed the unintended behavior where system env can be leaked into the final bundle.
lab
labβ€’2y ago
GitHub
[RFC] Pass down PLASMO_PUBLIC_ environment variables from system ...
How do you envision this feature/change to look/work like? Imagine in my system env, I have a PLASMOPUBLIC variable injected by bash profile or https://direnv.net/ What is the purpose of this cha...
lab
labβ€’2y ago
can you try 0.67.4 and lmk if it works @nahtnam
nahtnam
nahtnamβ€’2y ago
Yes, that fixed it @louis !
Want results from more Discord servers?
Add your server