You are referencing dotenv in your code, but it's in your devDependencies in your package.json. Heroku doesn't install devDependencies because they're supposed to only be used locally.
You shouldn't need to reference dotenv anywhere in code: your dev npm script already does this for local development (the -r dotenv/config bit). In production Heroku will set any environment variables for you (assuming you've configured them in your admin dashboard or using the Heroku CLI)
https://github.com/fac24/week3-alex-bereket-hallie-peter/blob/d217cd163d5b6025ba85217220e1c75404c6cef3/database/connection.js#L2-L4
You are referencing
dotenv
in your code, but it's in yourdevDependencies
in yourpackage.json
. Heroku doesn't install devDependencies because they're supposed to only be used locally.You shouldn't need to reference
dotenv
anywhere in code: yourdev
npm script already does this for local development (the-r dotenv/config
bit). In production Heroku will set any environment variables for you (assuming you've configured them in your admin dashboard or using the Heroku CLI)