Open waglik opened 2 years ago
I am having this same issue, but with a vue.js app. All is okay unless I initialize the app offline. Maybe it's an issue with firebase itself?
I think that everything was working in the Angular 11.x but when I have upgraded to 12.x the issue apperas every time when tha app is offline.. no idea what's wrong..
Same problem with Angular 12, Firebase auth won't get initialized and throws the error above in offline mode. For some reason it tries to load Google JS API according to logs which of course is not accessible oflline, this is the code which runs:
function _loadJS(url) {
// TODO: consider adding timeout support & cancellation
return new Promise((resolve, reject) => {
const el = document.createElement('script');
el.setAttribute('src', url);
el.onload = resolve;
el.onerror = e => {
const error = _createError("internal-error" /* INTERNAL_ERROR */);
error.customData = e;
reject(error);
};
el.type = 'text/javascript';
el.charset = 'UTF-8';
getScriptParentElement().appendChild(el);
});
}
onerror
callback fires, link it tries to load is:
https://apis.google.com/js/api.js?onload=__iframefcb792126
It works fine for me after updating firebase to latest version, 9.6.4 as of now.
@vnorbix I'll check and let it know here wheter upgrade to another version of firebase works for me as well. However thanks that you left a comment ;)
Hello
I've run into a problem when testing PWA app in offline mode. Everything works fine if app started with the Internet access and lost if afterwords. However if I refresh the page in the offline mode I get :
polyfills.a335baf6bc37129f.js:1 Unhandled Promise rejection: Firebase: Error (auth/internal-error). ; Zone: <root> ; Task: HTMLScriptElement.addEventListener:error ; Value: FirebaseError: Firebase: Error (auth/internal-error).
There is nothing happening in the component apart from being injected in the constructor.
In my app module I have following code:
Version info
Angular:13.0.0
Firebase:9.4.0
AngularFire:7.2.0
Other (e.g. Ionic/Cordova, Node, browser, operating system):
Debug output
Errors in the JavaScript console
Expected behavior
Initialize Firebase
Actual behavior
Error message. Firebase do not work.