Firebase deploy not updating JS file
I deployed a Firebase app, and made a change to one of the JavaScript files in the project. I re-executed firebase deploy
from the project directory, but the files on the site are not updating. When I deploy, the account management shows that an update occurs, but the file remains unchanged. Am I doing something incorrectly? How can I fix/troubleshoot this? Any help would be appreciated.
Thanks
Solution 1:
If the deploy is successful, this is likely a caching issue.
You can try pressing cmd+shift+R (ctrl+shift+R on Windows) to do a hard refresh of the cache.
Try going to the file's URL directly (https://<my-app>.firebapp.com/app.js
), and do a hard refresh. You should see it update to what you have locally.
With Chrome, you can have the cache disable when DevTools are open by selecting the "Disable cache" option in the Network tab.
Solution 2:
make sure you're building any new changes you've made before deploying.
For example if you have an angular 2 application and are using the angular cli type ng build then firebase deploy.
To clear cache press Ctr+F5 or better use incognito Mode for Development. using Incognito Mode for force reload works well for Mobile as well as desktop.
Solution 3:
If you're using React or Vue, do not forget to run the build command like npm run build before running the command firebase deploy