By ejf1990
Hi there, I have an Node/React app deployed to App Platform. I am facing a problem when I deploy any changes, I am not served the new production build files. I am served files but nothing gets rendered on the page. If I open the chrome debugger, and right click on refresh to get empty cache and hard reload, my app begins rendering again. I’d guess I am being served old production assets, and they’re no longer valid? Not sure why. Anyone had this problem?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
on further inspection it does seem the main.[HASH].js file is not being updated. Hard reloading via clearing cache does load the correct hashed js file. Is there a way to tell App Platform to clear the cache on deploy to the client?
For anyone who finds this, I believe I fixed it with the use of react-clear-cache to conditionally check for latest production builds. I also enabled the service worker in create react app via serviceWorker.register() in the top level index.js
After even further investigation, the react-clear-cache did not do the trick. Still looking for a solution to this.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.