0

I'am working with angular 5 + firebase project .I have an issue with firestore when adding new data to collection after hosting my project .

I have a form to submit ; in local environment it works very well but after deploying (hosting) my project it work the first time i open url project but for the second time it didnt work (only if i clean browser cache (CTRL+F5)) . No error in console is displayed .

Request to firestore keep pending then cancelled : Request initator is polyfill.bundle.js file in local environment the initiator is zone.js file After hosting project

I need some help to avoid this problem Thanks

  • "second time it didnt work".. not work the forms, only a specific form or all project? Are you using formgroup or something? – Diego Venâncio Jun 16 '18 at 13:07
  • Try clear cache before deploy like this: https://stackoverflow.com/a/36585119/4654957 – Diego Venâncio Jun 16 '18 at 13:08
  • thanks for your answer , I am using form group and all form in project didnt work second time : second time it means that i close navigator and i re open then i submit form – Houssine HASSAYOUN Jun 16 '18 at 16:26
  • hmm... Are your form group using some API WS or loading some data of database? After submit successful put this.yourFormName.reset(); test please. – Diego Venâncio Jun 16 '18 at 16:33
  • i'm using firestore as Db and form is for registration no API WS used . Same problem after adding reset on success of form submit , second time reset is not fired because the request is canceled as shown in the screen shot . I think it's related to configuration file "firebase.json" because this behavior is only after hosting my project – Houssine HASSAYOUN Jun 16 '18 at 17:41
  • it was a cache problem with service worker in my app which is activated only after hosting the project . i disable it and now forms work fine . i will try to figure a way to keep using service worker and avoid this issue – Houssine HASSAYOUN Jun 17 '18 at 20:54

0 Answers0