Android mobile terminal H5 error...
Error 1 FirebaseError Firebase: Error thrown when reading from storage. Original error: Firebase: Error thrown when opening storage. Original error: Version change transaction was aborted in upgradeneeded event handler.. (app/storage-open).. (app/storage-get).
error code:
throw ERROR_FACTORY.create(AppError.STORAGE_GET, { originalErrorMessage: (e as Error)?.message });
Error 2 FirebaseError Installations: Could not process request. Application offline. (installations/app-offline).
error code: const registrationPromiseWithError = Promise.reject( ERROR_FACTORY.create(ErrorCode.APP_OFFLINE) );
Error 3 FirebaseError Installations: Could not process request. Application offline. (installations/app-offline).
Error 4 ReferenceError fetch is not defined
error code: requiredApisAvailable(): boolean { if (!fetch || !Promise || !areCookiesEnabled()) { consoleLogger.info( 'Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled.' ); return false; }
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi @HChen318, please follow the issue template including the needed information so we can have a better understanding of the issue. Thanks.
Hi @HChen318, please follow the issue template including the needed information so we can have a better understanding of the issue. Thanks.
[REQUIRED] Describe your environment Operating System version: [Android 6.1.1] Browser version: Google Chrome 103.0.5060.114 Firebase SDK version: 9.1.1 Firebase Product: firebase Performance
[REQUIRED] Describe the problem We use firebase to report performance on the H5 page, and some Android models will report errors on the sentry monitoring platform
- Are you able to reproduce any of these errors locally on your own Android devices?
- Two of the errors say that the device is offline. Probably the device is offline? That seems normal enough?
- One of the errors says that
fetchis not defined. It's probably being used on a browser wherefetchis not defined, maybe an old browser. You listed one Google Chrome version above, is it the same version all the errors are being logged from? - I'm not sure what the first error is, how frequent is it? If it only occurs once it might just be something unusual happening in one case.
- Are you able to reproduce any of these errors locally on your own Android devices?
- Two of the errors say that the device is offline. Probably the device is offline? That seems normal enough?
- One of the errors says that
fetchis not defined. It's probably being used on a browser wherefetchis not defined, maybe an old browser. You listed one Google Chrome version above, is it the same version all the errors are being logged from?- I'm not sure what the first error is, how frequent is it? If it only occurs once it might just be something unusual happening in one case.
I can't reproduce it on my android phone. Google version varies, there are other versions such as chrome 45.0.24. The first problem is quite frequent. There are more than 400 users who report errors.
If we can't reproduce this error, it will be difficult to find the actual cause and fix it. The best we can do is guess. The first error is caused by a failed IndexedDB transaction, probably in the upgrade callback in the core app package, here: https://github.com/firebase/firebase-js-sdk/blob/e4eda86ea8c06f1bba9d7be5b2b314796439bd9e/packages/app/src/indexeddb.ts#L38
I can try wrapping the only statement in there, the db.createObjectStore() call, in an if check (to see if STORE_NAME exists) and maybe a try/catch block if that works on createObjectStore, and it might be a good idea in general to just add more error handling there, but since we can't reproduce your problem, there's no guarantee this will fix it specifically.
I can't reproduce it on my end after messing around with various db versions and trying to force it into an odd state. Can you share anything about your code? How are you importing and initializing app and performance? Are you using performance standalone?
Edit: My best guess is that perhaps you have a situation where you're somehow loading 2 versions of firebase/app and they're both trying to open idb at the same time and there's a race condition perhaps?
ok in index.js use
import { initializeApp } from 'firebase/app' import { getAnalytics } from 'firebase/analytics' import { getPerformance } from 'firebase/performance'
const firebaseConfig = { apiKey: 'x',xxxx authDomain: 'xxxx', projectId: 'xxx', storageBucket: 'wx', messagingSenderId: 'xxx', appId: 'x',xx measurementId: 'x'xxx }
// Initialize Firebase const app = initializeApp(firebaseConfig) const analytics = getAnalytics(app) const perf = getPerformance(app)
Everything looks correct and I can't reproduce it with a similar setup. I can try to wrap db.createObjectStore() in more error handling, but no guarantee that will fix your problem unless you can provide a sample app that can consistently reproduce the error locally. I will update this issue when I've made a PR for the error handling.
Everything looks correct and I can't reproduce it with a similar setup. I can try to wrap
db.createObjectStore()in more error handling, but no guarantee that will fix your problem unless you can provide a sample app that can consistently reproduce the error locally. I will update this issue when I've made a PR for the error handling.
ok, I am following
Hey @HChen318. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@HChen318 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.