firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

Error when losing/retrieving network connection

Open LanderBeeuwsaert opened this issue 5 months ago • 5 comments

Operating System

macOS 10.15.7 Catalina desktop Apple

Environment (if applicable)

Chrome 138.0.0.0

Firebase SDK Version

11.10.0

Firebase SDK Product(s)

Firestore

Project Tooling

angular + angularFire

Detailed Problem Description

the user seemed to lose/regain network connection when it happened

Steps and code to reproduce issue

We have communicated about this error message before here: https://github.com/firebase/firebase-js-sdk/issues/8856 I'm creating a new ticket, because the issue isn't during logout, but when the user is losing network connection

message: FIRESTORE (11.10.0) INTERNAL ASSERTION FAILED: Unexpected state (ID: ca9) CONTEXT: {"ve":-1}

stacktrace: Error: FIRESTORE (11.10.0) INTERNAL ASSERTION FAILED: Unexpected state (ID: b815) CONTEXT: {"hc":"Error: FIRESTORE (11.10.0) INTERNAL ASSERTION FAILED: Unexpected state (ID: ca9) CONTEXT: {"ve":-1}\n at u$ (https://www.acro-companion.com/chunk-JGHCOMLU.js:25:10937)\n at Kt (https://www.acro-companion.com/chunk-JGHCOMLU.js:25:11026)\n at Hy.Ue (https://www.acro-companion.com/chunk-JGHCOMLU.js:28:4938)\n at https://www.acro-companion.com/chunk-JGHCOMLU.js:28:5371\n at Array.forEach ()\n at hD.forEachTarget (https://www.acro-companion.com/chunk-JGHCOMLU.js:28:5663)\n at hD.et (https://www.acro-companion.com/chunk-JGHCOMLU.js:28:5264)\n at https://www.acro-companion.com/chunk-JGHCOMLU.js:34:2476\n at Generator.next ()\n at https://www.acro-companion.com/chunk-4ZXV5L7B.js:1:1748"} at u$ (https://www.acro-companion.com/chunk-JGHCOMLU.js:25:10937) at et (https://www.acro-companion.com/chunk-JGHCOMLU.js:25:10738) at ob.ac (https://www.acro-companion.com/chunk-JGHCOMLU.js:37:36657) at ob.enqueue (https://www.acro-companion.com/chunk-JGHCOMLU.js:37:35848) at ob.enqueueAndForget (https://www.acro-companion.com/chunk-JGHCOMLU.js:37:35590) at https://www.acro-companion.com/chunk-JGHCOMLU.js:33:36356 at HD.r_ (https://www.acro-companion.com/chunk-JGHCOMLU.js:33:36073) at HD.__ (https://www.acro-companion.com/chunk-JGHCOMLU.js:33:29659) at https://www.acro-companion.com/chunk-JGHCOMLU.js:33:32447 at vs. (https://www.acro-companion.com/chunk-JGHCOMLU.js:33:32073)

LanderBeeuwsaert avatar Jul 19 '25 08:07 LanderBeeuwsaert

facing this same issue for many months. What is the fix? This error does not come if we don't do this

const db = initializeFirestore(app, {
    localCache: persistentLocalCache()
  });

and do this instead

const db = getFirestore(app);

But I want offline capability.

I tried with 12.0.0 even here i am getting same error:

[2025-08-04T04:13:31.773Z]  @firebase/firestore: Firestore (12.0.0): INTERNAL UNHANDLED ERROR:  DataCloneError: Failed to execute 'put' on 'IDBObjectStore': #<Object> could not be cloned.

vinz avatar Aug 04 '25 04:08 vinz

still stuck. anyone any solution or work around to this?

vinz avatar Aug 06 '25 11:08 vinz

Sorry for the delayed response. Can you describe what happens after this error, does the SDK stopped functioning since that point?

Is it possible to get:

  • debug log from the SDK
  • A minimum reproduction app

wu-hui avatar Aug 07 '25 17:08 wu-hui

@wu-hui See also another user reporting the same issue: https://github.com/firebase/firebase-js-sdk/issues/8383

see also my proposal here what would help us get this sort of debug logging: https://github.com/firebase/firebase-js-sdk/issues/7590#issuecomment-3172745204

LanderBeeuwsaert avatar Aug 10 '25 17:08 LanderBeeuwsaert

We are still blocked, unable to upgrade to latest version of firestore.

vinz avatar Dec 02 '25 06:12 vinz