I’ve tried every possible thing, I’ve been on the use the .env file challenge, but no matter what it doesn’t pass. I’ve compared it to similar answers and it is exactly the same as the ones that do, from what I can see. I don’t like reposting the same question but I’ve tried pretty much everything I could find/think of, this was a last resort haha
I have a blank .env file with MESSAGE_STYLE=uppercase, so that’s not the problem either
ah! that turned out to be the problem, I didn’t understand what the root directory was referring to and I assumed it was views because that’s where index was. I moved that out and it passed, thank you! it did end up just being something I didn’t understand well, which was how directories work and .env files in general haha
also I would like to clarify for anyone finding this thread in the future, only authors and contributors can see .env files so that’s why it wasn’t showing up for some people (or something like that, I saw that in some other threads)
I realized I’m having a new problem: it passes but after I submit it, it shows the “Cannot set headers after they are sent to the client” error. I poked around google, and I do see that in around 2020 there was a package that broke after some update? it’s been years since then so I’m doubting it’s the culprit, but the problem is, I only am seeing posts about that and nothing from 2024.
does anyone know any fixes for this, or is it still erroring out from that package breaking all those years ago?
I did a little search about it and here is what I got:
This error occurs when you try to set HTTP header after the response is already sent to the client.
Here, if the condition is met it will send the HELLO JSON but since there is no return or you put the another response in else statement for example, it will try to send it too and that’s where the error occurs.
I tried to use return with the HELLO JSON line and the error disappeared.