Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Webpack issue on Heroku #135

Open
zkwsk opened this issue Jul 22, 2020 · 0 comments
Open

Webpack issue on Heroku #135

zkwsk opened this issue Jul 22, 2020 · 0 comments

Comments

@zkwsk
Copy link
Contributor

zkwsk commented Jul 22, 2020

We use dotenv-webpack to have access to env variables from within React, not just on the server side.

Webpack cannot build on heroku because dotenv-webpack can't find a .env file. Reason being that you don't actually have a .env file on Heroku but all env vars are being managed in the Heroku interface.

This seems to be the solution:

https://stackoverflow.com/questions/59759085/heroku-failed-to-load-env

But I don't understand how we managed to get the class-11 final project build?

Further, the configuration in the boilerplate and class-11 is a bit different. There is not "path" in the boilerplate, leading me to believe that parsing env vars from .env during webpack build does not work in the boilerplate. Please check this and verify that the project not only builds on heroku, but it also parses env-vars during webpack build.

new Dotenv({
safe: false,
}),

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant