Ask coding questions

← Back to all posts
secret variables are not working
zkindest (1)

Program failed to use env variables even though it's defined in secrets.

check https://replit.com/@zkindest/boilerplate-project-urlshortener#db.js

Resolution

It's working fine when I use "Run" button but If I start the server using cli(npm run start),it failed to use env variables.

Comments
hotnewtop
zkindest (1)

It's working fine when I use "Run" button but If I start the server using cli,it failed to use env variables.

Wumi4 (532)

Ummm... Where is the secret variable? Also, the service doesn't seem to work.

zkindest (1)

@Wumi4 it's failing because of unavailbility of env variable

JBloves27 (1887)

I think they mean env's @Wumi4