# Replit.com no longer allows for the creation of .env files

**URL:** <https://forum.freecodecamp.org/t/replit-com-no-longer-allows-for-the-creation-of-env-files/456144>\
**Category:** I Built This\
**Created:** [April 16, 2021, 10:59am UTC](https://forum.freecodecamp.org/t/replit-com-no-longer-allows-for-the-creation-of-env-files/456144 "2021-04-16T10:59:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![camchardukian](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/camchardukian/32/56045_2.png) [@camchardukian](https://forum.freecodecamp.org/u/camchardukian)\
**Post date:** [April 16, 2021, 10:59am UTC](https://forum.freecodecamp.org/t/replit-com-no-longer-allows-for-the-creation-of-env-files/456144/1 "2021-04-16T10:59:05Z")

</div>

It seems on [Replit.com](http://Replit.com) it’s no longer to create a .env file. Instead they ask you to put you configure your environment in the left sidebar in what looks to be called the ‘Secrets section’.

With the .env file my app worked as expected on [Replit.com](http://Replit.com). I’m having issues getting the app to run correctly with these new ‘secrets’, however.

My app connects to MongoDB, and the functional tests pass, I then get a message that my Repl cannot be reached.

It seems the introduction of ‘secrets’ has just occured in the last few days so I can’t find any documentation on FCC to refer to. For that reason I thought I’d make a post for both myself and anyone else that may be struggling with this issue.

In my server.js and fcctesting.js files I tried to replace instances of process.env.PORT, and process.env.DB with my new ‘secret’ variables like PORT and DB, but my app still isn’t working correctly.

Any advice?

[Project Link](https://replit.com/@camchardukian/FCC-Project-Issue-Tracker-3)

[GitHub Link (with original .env implementation)](https://github.com/camchardukian/FCC-Project-Issue-Tracker)

 ![Replit.com Secrets](https://global.discourse-cdn.com/freecodecamp/original/3X/7/7/770ff4901a9d7ec3e68d3c74c3f138813b75e589.png)

---

<div class="post-metadata">

**Author:** ![camchardukian](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/camchardukian/32/56045_2.png) [@camchardukian](https://forum.freecodecamp.org/u/camchardukian)\
**Post date:** [April 19, 2021, 10:23am UTC](https://forum.freecodecamp.org/t/replit-com-no-longer-allows-for-the-creation-of-env-files/456144/2 "2021-04-19T10:23:05Z")

</div>

I am still working to try to solve this issue. Here are two additional reference links I’ve gathered and read through.

[The .env file has been deprecated on Replit](https://docs.replit.com/repls/secret-keys).

[Secrets and environmental variables](https://docs.replit.com/repls/secrets-environment-variables).

Despite reading through these links, I still haven’t had any luck fixing the “Hmmmm… We couldn’t reach you repl” issue.

I will keep trying different things and update this thread if I find a solution.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [April 19, 2021, 10:25am UTC](https://forum.freecodecamp.org/t/replit-com-no-longer-allows-for-the-creation-of-env-files/456144/3 "2021-04-19T10:25:25Z")

</div>

here, it’s pinned under #freeCodeCamp Support

> [@Replit Create a .env File Changed](https://forum.freecodecamp.org/t/replit-create-a-env-file-changed/456125/):
>
> Recently, Replit have adjusted their editor to no longer allow .env files to be created. As such, in order to use environment variables, a new tab in the left pane has been added which looks like a lock lock To add an environment variable, place the variable name in the key input, and the value in the value input.

---

<div class="post-metadata">

**Author:** ![camchardukian](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/camchardukian/32/56045_2.png) [@camchardukian](https://forum.freecodecamp.org/u/camchardukian)\
**Post date:** [April 19, 2021, 10:30am UTC](https://forum.freecodecamp.org/t/replit-com-no-longer-allows-for-the-creation-of-env-files/456144/4 "2021-04-19T10:30:06Z")

</div>

Hey @ILM, thank you for your response. As you can see from my image I have already added the key/value pairs as your link suggests.

Despite this, however, I am still running into the problems I mentioned above.

---

<div class="post-metadata">

**Author:** ![camchardukian](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/camchardukian/32/56045_2.png) [@camchardukian](https://forum.freecodecamp.org/u/camchardukian)\
**Post date:** [April 20, 2021, 2:12am UTC](https://forum.freecodecamp.org/t/replit-com-no-longer-allows-for-the-creation-of-env-files/456144/5 "2021-04-20T02:12:42Z")

</div>

I found the issue so I’m going to update this post just in case anyone else got stuck. It seems the boilerplate code includes the following line:

```auto
require("dotenv").config();

```

You need to remove this line as it attempts to load the environmental variables from a .env file (which we no longer have due to the introduction of REPLIT secrets). Hope someone finds this useful!

---

<div class="post-metadata">

**Author:** ![Akashac\_21](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/akashac_21/32/216027_2.png) [@Akashac\_21](https://forum.freecodecamp.org/u/Akashac_21)\
**Post date:** [May 1, 2021, 9:24am UTC](https://forum.freecodecamp.org/t/replit-com-no-longer-allows-for-the-creation-of-env-files/456144/6 "2021-05-01T09:24:04Z")

</div>

Very helpful , this helped me solve my issue in replit for which i was scratching my head for days 😂

---

<div class="post-metadata">

**Author:** ![francesca.giammichel](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/francesca.giammichel/32/208869_2.png) [@francesca.giammichel](https://forum.freecodecamp.org/u/francesca.giammichel)\
**Post date:** [May 27, 2021, 11:21am UTC](https://forum.freecodecamp.org/t/replit-com-no-longer-allows-for-the-creation-of-env-files/456144/7 "2021-05-27T11:21:49Z")

</div>

where can I find this line to edit? I have checked in all the files of the project but cannot find it ☹

---

<div class="post-metadata">

**Author:** ![camchardukian](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/camchardukian/32/56045_2.png) [@camchardukian](https://forum.freecodecamp.org/u/camchardukian)\
**Post date:** [June 20, 2021, 3:58am UTC](https://forum.freecodecamp.org/t/replit-com-no-longer-allows-for-the-creation-of-env-files/456144/8 "2021-06-20T03:58:27Z")

</div>

I apologize for the late reply (it’s been several weeks since I’ve logged into the forum). I’m pretty sure it’s in the server.js file, but it’s also possible they’ve updated the boilerplate code since my first post.

Good luck! 😀

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [December 19, 2021, 3:58pm UTC](https://forum.freecodecamp.org/t/replit-com-no-longer-allows-for-the-creation-of-env-files/456144/9 "2021-12-19T15:58:39Z")

</div>

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