A strange bug in nodejs env


I found a strange bug with nodejs on glitch. I use .env file and ‘dotenv’ to read the file. Everything runs fine until I used this kind of config.

If I console.log(process.env.test), I got {key:1234} while in other platform or my local machine I got {“key”:“1234”} .
The double quotations were removed and made the json string unusable. In my test, it only happens on glitch platform.

Do you see the same problem?



because Glitch runs in a container and not locally, you may encounter some different features/bugs than when you try locally.

ENV is a shell file. It currently doesn’t support quotations or spaces.

process.env.password=ABC123! is the correct syntax to use. You can also use the graphic toggle to access a less-progammy version

What you can try is:

var password = {“key”: process.env.key} //env.key would hold the 1234 value. 

Hope this helps:)