https://serverless-stack.com/ logo
#sst
Title
# sst
d

Dan Van Brunt

11/04/2021, 8:18 PM
Not sure if I’m doing something wrong but suddenly our
.env.local
env vars are not being loaded into the process.env in the
sst.Stack
we just moved from
0.48.0
to
0.50.2
t

thdxr

11/04/2021, 8:19 PM
Is this under SST start
d

Dan Van Brunt

11/04/2021, 8:20 PM
yes
yarn start
but I have this in package.json
“scripts”: { “test”: “sst test”, “start”: “sst start”, “build”: “sst build”, “deploy”: “sst deploy”, “remove”: “sst remove”, “buildfrontend” “ls” },
file is in root…
contents of env.local
DATADOG_API_KEY=NOTTELLING
stack.ts
console output…
🤦‍♂️ I guess I need to get the var INSIDE the
sst.Stack
moving it into the stack code WORKED
g

Garret Harp

11/04/2021, 8:28 PM
thats weird mine works even outside the stack
d

Dan Van Brunt

11/04/2021, 8:28 PM
I thought mine did before too. 🤷
t

thdxr

11/04/2021, 8:43 PM
That's strange 🤔
ö

Ömer Toraman

11/04/2021, 8:59 PM
@Dan Van Brunt Can you restart the process? 😄
It’s because environment variables are loaded only once and at the beginning of the Node process.
d

Dan Van Brunt

11/04/2021, 9:00 PM
restart which process ?
I’ve definitly stopped the
yarn start
process and then run it again
the above is still true
only works for me IN the stack
ö

Ömer Toraman

11/05/2021, 9:09 AM
I see. I have no idea why…