Core: Production Build: E_MISSING_ENV_VALUE: Missing environment variable "HOST"

Created on 4 Nov 2020  路  8Comments  路  Source: adonisjs/core

Steps:

  1. Created a new API project using Yarn
  2. Run "yarn build"
  3. Run "node build/server.js"

Error:

E_MISSING_ENV_VALUE: Missing environment variable "HOST"

Invalid

Most helpful comment

I have opened a discussion to see what is going on: https://github.com/adonisjs/core/discussions/1874

It may be an issue with "@adonisjs/core": "5.0.4-preview-rc-2" as someone also reported this on Stack Overflow. It looks like the .env file is not copied anymore in the build folder.

All 8 comments

Because you have not placed .env file in your project root folder. Copy example env file and rename it to .env

What? you mean when the app is created from the start/fresh it doesnt put the .env on root? It doesnt make sense.

Do not create issues until it is confirmed as an issue by someone. Use Github discussions instead

Why close? Its happening @thetutlage

May I know why you cannot create a Discussion thread for this?

I am reporting it as an issue for you. I am helping you man. If you want you can verify. It would take you only 5 mins to verify. I have given you the steps.

I love your framework thats why I am helping you.

No need to help me. If you are looking for help, then use Github discussions like everyone else.

I have opened a discussion to see what is going on: https://github.com/adonisjs/core/discussions/1874

It may be an issue with "@adonisjs/core": "5.0.4-preview-rc-2" as someone also reported this on Stack Overflow. It looks like the .env file is not copied anymore in the build folder.

Was this page helpful?
0 / 5 - 0 ratings