Why can't I add a new .env file

Question:


Why can’t I add a new .env file, I have already installed dotenv.
Repl link:

Hey @Residual2023528 welcome to the forums!

Because the .env file would still be public. Instead you can use secrets witch is the same but it will truly keep your keys and stuff secret https://docs.replit.com/programming-ide/workspace-features/secrets

5 Likes

you see, but why can’t we make it … private ;-;

4 Likes

I do not know. My guess is because Replit’s infrastructure is not built to hide it and it would not be easy to hide it because of all the places it could be shown.

5 Likes

oh ok sorry then :frowning: I wish we could rework it that way but oh well. The only thing confusing me is that it used to work with infra so I wonder what they changed…

3 Likes

Thank you, but I have another question that has nothing to do with this. Why is the package.json of replit different from that of vscode? Can I add this line (please see the circled part of the picture)?

The reason why I want to add this line is because of this teaching, he added it this way, I want to say that it will be more convenient when studying in the future.

yes you can add it to replit

4 Likes

We disabled .env files a while back due to a vulnerability that allowed anyone to access them.

4 Likes

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