"Use the .env File" challenge not passing

Tell us what’s happening:
Describe your issue in detail here.
I’m not sure what the issue is. I’m using the secret tab variable for MESSAGE_STYLE. The code works and converts “Hello json” to uppercase if the env variable’s value “uppercase”. You can check the /json path to see it works.

I’m not sure its a formatting issue or not but its not passing the challenge.

Your project link(s)

solution: https://replit.com/@apex-coder/boilerplate-express

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36

Challenge: Use the .env File

Link to the challenge:

const mySecret = process.env[‘MESSAGE_STYLE’].trim();

You don’t want to have this as a global variable, try to keep your variables in the smallest/innermost scope possible to avoid unexpected behaviour

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.