Need help! JavaScipt

I am getting an error. Here is a picture of the error. Please help if you can :smiley: :.D
Screenshot 2021-05-27 163008

In this part of the video, he created a .env file in, and I cant do that.

Link to Video

Challenge: Handle Click Events with JavaScript using the onclick property

Link to the challenge:

as written there you can’t create an .env file
it is a recent change you need to use the Secret tab in the menu to the left

1 Like

I don’t understand. I cant see a Secret Tab on the left

this one


Hey @Shadow2 ,

In the sidebar (which is the left of the screen in replit) there is a button that looks like a lock, that’s the secret tab:

1 Like

Hi @Catalactics,

I checked that our right now, thanks! So, after I open that, what do I do next? In this Video, he makes a .env file. I don’t get it though…

instead of writing a key=value like shown in the video, you write the two things in the two fields

1 Like

What two things in the two fields??

So when he puts MONGO_URI you put that inside the ‘key’ and your secret inside the ‘value’ input

1 Like

the key in the key field, the value in the value field

in this case I think it’s something like MONGO_URI=gibberish, so MONGO_URI in the key field, and the gibberish in the value field

1 Like

Okay, thanks. I will try that, and let you know if it works :smiley:

Thanks! I will ty this as well.

note that it’s the same thing explained in two different ways, not two different things

1 Like

Hi again,

I tried the suggestion you made to me, but it made this
const mySecret = process.env['.env']. Can you walk me through/help to solve the challenge?

I haven’t done replit, but if it’s handling the env variable for you, then you shouldn’t need to worry about the “.env” file, all of your environment files will just become part of the process.env object. So, you if you created an environment variable called “API_KEY”, then you’d access it as process.env.API_KEY in your code.

Or, seeing Catalactics post, you would access that variable as process.env.MONGO_URI.

1 Like

Thank you very much, sir! I think, I will just do the test for this section in Glitch.

Thank you everyone for the help!!

1 Like

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