Skip to content

Angular10 - Loading chunk firebase-analytics failed #2575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kousenlsn opened this issue Aug 25, 2020 · 6 comments
Closed

Angular10 - Loading chunk firebase-analytics failed #2575

kousenlsn opened this issue Aug 25, 2020 · 6 comments

Comments

@kousenlsn
Copy link

Version info

Angular: 10.0.5 / 10.0.1 / 10.0.0

Firebase: 7.19.0 / 7.15.1

AngularFire: 6.0.2 / 6.0.3-canary.93912bc

Other (e.g. Ionic/Cordova, Node, browser, operating system): Any browser, Mac

How to reproduce these conditions

  • Create a new Angular project via CLI (ng new test-project) (Angular CLI 10.0.4)
  • Install firebase and Angular/fire
  • Import to app.modules, and to a constructor the analytics service.
  • (optional) add to angular.json "allowedCommonJsDependencies": [ "firebase/app", "@firebase/auth"] to disable ES module / commonjs module warning at the console.

Additional:
I tried to use npm i @angular/fire@canarywithout any success, following #2526, and even downgrading the versions of both Angular and firebase.

I also tried to disable vendor-chunk and common-chunk, and some multiple other options.

Debug output

Screen Shot 2020-08-25 at 10 56 48

Screen Shot 2020-08-25 at 10 58 33

Expected behavior

Imports and works ?!

Actual behavior

Error at the console, can't use the service.

@HugoSart
Copy link

Had the same issue. In my case, I found out that my AdBlock was preventing the library from downloading the firebase-analytics file.

@kousenlsn
Copy link
Author

@HugoSart Wow I can't believe it, it is indeed AdBlock, it works when disabled. Now I don't know what to do, as I can't control that

@jdmasoft
Copy link

jdmasoft commented Sep 3, 2020

i have the same problem :( , thank for the answer, i disable adblocker for my page and this works.. the error disapier

@Splaktar
Copy link
Contributor

I'm not sure that there is much that the library can do to avoid ad blockers. Most likely any update would be met with a change to the ad blocker to make sure that it breaks loading again.

@jdmasoft
Copy link

jdmasoft commented Sep 24, 2020 via email

@Merwan1010
Copy link

Does it mean that firebase analytics won't be able to send data from user using adBlock/uBlock Origin ?
Or this issue only occur during debug / development mode ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants