Ask coding questions

← Back to all posts
Stop replit from validating a .env file
h
wgyt

I know that env files are deprecated, but my program uses the .env file to store json data that can't be public. When I restart the repl it gets mad at me with an error, which I don't want to happen, because I can't run my program.

https://replit.com/@onedotprojects/onestate-server#index.js is my repl

Voters
RedGuy7
wgyt
Comments
hotnewtop
SixBeeps

Oh no no no no don't put JSON data in the .env, that's extremely janky. Set up a database to handle that.

wgyt

@SixBeeps it is intentional, the database writes to a file and I set it to use .env so it would be hidden

IMayBeMe

You could transfer the env file data to the new section and then delete it after

wgyt

@IMayBeMe That isn't what I mean, the data needs to be in the .env file, I want replit to stop validating the .env file

IMayBeMe

@wgyt oh, maybe clear the console, but other than that I'm not sure

wgyt

@IMayBeMe That wouldn't help

IMayBeMe

@wgyt I meant through the code, not manually, but that probably won't solve it.

wgyt

@IMayBeMe the code never runs so this won’t help