-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
environment variables undefined #50
Comments
Hi @crashspringfield Thanks for reporting this. It's mentioned over here https://www.robinwieruch.de/minimal-node-js-babel-setup/ with the order of importing as well. But you are right, maybe it should be mentioned again for environment variables. It's too easy to run into an error with them. Sorry again! |
I'm getting the same issue but adding that import to /models/index.js didn't solve it for me. I followed the steps listed in the readme, no other changes made, and get the following error:
|
Nevermind, I totally forgot that .env is ignored by git so I need to recreate it after pulling from my local repo. It's all good, working now. |
Finally added over here: the-road-to-graphql/the-road-to-graphql@643356c I keep this issue open for people with the old version of the book though. |
Anyone who runs into this issue and finds this issue, please comment. If I find no comment here the next time I get to this issue, I will close it :) |
Had same issue, OP helped solve it. |
When I try to start the site (~p. 248), I'm met with the following error:
Unhandled rejection SequelizeConnectionError: password authentication failed for user "crash"
which caught me off guard because my
.env
file is:After going down the rabbit hole with Postgres and permissions and still not solving the issue I tried logging my environment variables only to find them undefined. (Really, that should have been the first place I checked).
I was able to fix the issue by updating
/models/index.js
and adding:I see it also exists in
/src/index.js
in the repo, but the book never specifies adding it anywhere. Updating the code for the index on p. 243 would save the reader a lot of troubleshooting.The text was updated successfully, but these errors were encountered: