Insight as to why this might not work with Heroku deployment?
See original GitHub issuenpm run build
successfully appends the file when I run it locally but not when Heroku runs it during deployment. I can see that it’s running the script in the deploy logs but when I view the file in build
it doesn’t have the appended code.
=====> Detected Framework: React.js (create-react-app)
Using existing `static.json`
Enabling runtime environment variables
> react-app@0.1.0 build /tmp/build_...
> npm run build-css && react-scripts build && cra-append-sw ./custom-sw.js
Thanks for making this workaround!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Troubleshooting Node.js Deploys - Heroku Dev Center
Your Node.js deploy failed - now what? Start with these simple steps to troubleshoot a build issue. Check the buildpack. Is the app...
Read more >Deploying to heroku does not work · Issue #221 · rauchg/slackin
It appears to be due to this line, which expects dist/ to exist, but does not by default, since it is ignored from...
Read more >Heroku app deployed successfully but Application Error
I'm trying to deploy a simple python Dash app to Heroku, I can deploy the app without any issues but I keep getting...
Read more >7. When It Goes Wrong - Heroku: Up and Running [Book]
Not to worry, though—deployment is the best place your application could fail. Ideally, it means that you just avoided deploying an app with...
Read more >Heroku deploy not working, app working on local machine
Open a terminal. Run heroku logs -t , and then using a different terminal, browser, whatever, cause the error. You will then have...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Update: When I use the
--skip-compile
flag it works as expected!So just to summarize, without the flag
npm run build
works fine locally, but not when deployed via Heroku (babel-loader error seen in the build logs above occurs and the file is not appended).Thanks for your tool!
FWIW i am getting a similar issue when trying to build. Isolated the same behavior by running it directly from the bin folder in node_module install folder. Calling it directly on the
custom-sw.js
i created. ----Output—