I think the issue here is that heroku is searching for my bundle.js in the wrong location.
Heroku is looking for my bundle in the default location ('/app/build/static/js/*.js'), but I have set the custom bundle location specified in my webpack.config and static.json files using
heroku config:set JS_RUNTIME_TARGET_BUNDLE: /app/dist/*.js
as explained here (https://github.com/mars/create-react-app-buildpack/blob/master/README.md#user-content-custom-bundle-location). I'm new to heroku and very inexperienced in programming in general and I can't figure out why heroku is still looking for my bundle in the default location. Significant snippets from my webpack.config and static.json files are below.
webpack.config.js
entry: './src/index.js',
output: {
path: path.join(__dirname, '/dist'),
filename: 'bundle.js'
},
static.json
"root": "dist/",
"clean_urls": false,
"routes": {
"/**": "src/index.html"
}
}
When I run heroku logs --tail I get the following. As you can see, heroku is looking for my bundle in the default location.
2019-10-04T02:04:43+00:00 app[api]: Build succeeded
2019-10-04T02:04:55.38611+00:00 heroku[web.1]: Starting process with command `bin/boot`
2019-10-04T02:04:56.977667+00:00 heroku[web.1]: State changed from starting to up
2019-10-04T02:04:56.675665+00:00 app[web.1]: ls: cannot access '/app/build/static/js/*.js': No such file or directory
2019-10-04T02:04:56.676135+00:00 app[web.1]: Error injecting runtime env: bundle not found '/app/build/static/js/*.js'. See: https://github.com/mars/create-react-app-buildpack/blob/master/README.md#user-content-custom-bundle-location
2019-10-04T02:04:56.890081+00:00 app[web.1]: Starting log redirection...
2019-10-04T02:04:56.890346+00:00 app[web.1]: Starting nginx...
Please let me know if you see anything wrong with my paths/if you have any ideas for how to get heroku to find my bundle.js file.
Thanks so much