mars / create-react-app-buildpack

⚛️ Heroku Buildpack for create-react-app: static hosting for React.js web apps
MIT License
3.28k stars 653 forks source link

Boot timeout injecting runtime env #134

Closed peterpetre closed 6 years ago

peterpetre commented 6 years ago
...
2018-10-09T10:37:21.306474+00:00 app[web.1]: Injecting runtime env into /app/build/static/js/199.82db94da.chunk.js (from .profile.d/inject_react_app_env.sh)
2018-10-09T10:37:21.331105+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-10-09T10:37:21.331368+00:00 heroku[web.1]: Stopping process with SIGKILL
2018-10-09T10:37:21.441116+00:00 heroku[web.1]: Process exited with status 137
2018-10-09T10:37:21.462457+00:00 heroku[web.1]: State changed from starting to crashed
peterpetre commented 6 years ago

@mars The master is not compatible anymore with CRA v1.x? need to upgrade to v2.x?

mars commented 6 years ago

Hi @peterpetre, sorry to hear that. It should still work for CRA 1.x, but this looks like output from either CRA 2.x or an ejected app.

What else is logged? Are there other “Injecting“ lines logged? Please paste the complete log from restart/release to the failure.

That looks like it’s processing over 199 chunks. After you run npm run build locally, what is output from ls -hal build/static/js/?

mars commented 6 years ago

Also,

If a custom Procfile is defined, please paste its contents here.

And please paste contents of package.json.

peterpetre commented 6 years ago

Hi, in general few hours ago, i just used https://github.com/mars/create-react-app-buildpack.git#v6.0.0 than master and now is ok.

But actually we are using intl polyfill in the code, and we import the locale-data dynamically with import(intl/locale-data/jsonp/${locale}), so pretty much all the chunks were from it. I just changed it to dynamic import only the locales we are supporting, and the chunks are few now.

*There were 199 injecting lines logged, no custom Procfile.