Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 342
user3660665 Avatar asked Dec 10 '15 02:12

user3660665


People also ask

How do you update a file that I deployed to Firebase hosting?

You cannot change hosted files in the Firebase Console. Instead, you should change the index. html on your local copy where you initially ran the firebase deploy command. Once you're done with the changes, run firebase deploy again to push the updated version of your website to Firebase Hosting.

What script should be run before every deploy firebase?

To deploy resources from a project directory, the project directory must have a firebase. json file. This file is automatically created for you by the firebase init command.

Can you host node js on Firebase?

Firebase Hosting supports a REST API for advanced developers to build custom workflows, like deploying through a JavaScript app. We also have a Node. js module which you can import into your Node. js apps to build advanced functionality.


Video Answer


2 Answers

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.

enter image description here

like image 183
David East Avatar answered Sep 21 '22 03:09

David East


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.

like image 45
aheigins Avatar answered Sep 22 '22 03:09

aheigins