Skip to content

TypeError: Cannot read properties of undefined (reading 'mutations') #7721

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
jamesdaniels opened this issue Oct 25, 2023 · 5 comments
Closed

Comments

@jamesdaniels
Copy link
Member

jamesdaniels commented Oct 25, 2023

Operating System

Various

Browser Version

Chrome/118.0.5993.88

Firebase SDK Version

10.5.0

Firebase SDK Product:

Firestore

Describe your project's tooling

Angular 16.2.7, Karma 6.4.2, Node 18

Describe the problem

In my karma tests (against the emulators) I'm running into tons of failures with Firestore, one culprit appears to be this !:

const batch = remoteStoreImpl.writePipeline.shift()!;

Stack trace:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'mutations')
    at Function.from (index.esm2017.js:5483:32)
    at index.esm2017.js:14876:53
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _next (asyncToGenerator.js:22:1)
    at asyncToGenerator.js:27:1
    at ZoneAwarePromise (zone.js:1411:21)
    at asyncToGenerator.js:19:1
    at __PRIVATE_onMutationResult (index.esm2017.js:14874:42)
    at __PRIVATE_PersistentWriteStream.onMessage (index.esm2017.js:14334:3

Seems to be related to a bunch of these too, maybe failed/aborted tests put Firestore into a bad state?

Uncaught Error: FIRESTORE (10.5.0) INTERNAL ASSERTION FAILED: Unexpected state
    at fail (index.esm2017.js:194:34)
    at __PRIVATE_AsyncQueueImpl.ou (index.esm2017.js:18396:20)
    at __PRIVATE_AsyncQueueImpl.enqueue (index.esm2017.js:18312:18)
    at __PRIVATE_AsyncQueueImpl.enqueueAndForget (index.esm2017.js:18297:14)
    at DelayedOperation.handleDelayElapsed (index.esm2017.js:15076:25)
    at index.esm2017.js:15058:51
    at timer (zone.js:2367:41)
    at _ZoneDelegate.invokeTask (zone.js:402:31)
    at ProxyZoneSpec.onInvokeTask (zone-testing.js:304:39)
    at _ZoneDelegate.invokeTask (zone.js:401:60)

Steps and code to reproduce issue

Use Firestore in Karma (Angular's test tooling)

@jamesdaniels jamesdaniels added question new A new issue that hasn't be categoirzed as question, bug or feature request labels Oct 25, 2023
@jamesdaniels
Copy link
Member Author

Related? angular/angularfire#3448

@jbalidiong jbalidiong added needs-attention and removed new A new issue that hasn't be categoirzed as question, bug or feature request labels Oct 25, 2023
@hsubox76
Copy link
Contributor

I don't think it's related to that bug, that user opened what I think is the same issue in our repo: #7712 where the same test works if they use karma - in that case it's a module resolution issue.

About this issue, since it's using emulators I wonder if it's related to recent changes Firestore made that require the latest versions of the emulators and an EXPERIMENTAL_MODE flag? #7637 These don't look like the same failure though.

@tom-andersen tom-andersen self-assigned this Nov 1, 2023
@tom-andersen
Copy link
Contributor

tom-andersen commented Nov 1, 2023

@jamesdaniels We had a problem with read stream that might be affecting the write stream as well. Unfortunately, this is an intermittent problem that was only reproducible under certain conditions.

Could you upgrade to version 1.5.2 of Firebase SDK? We released 15.2 to fix the read problem.

Also, if you have a test that consistently fails, but it fixed with 1.5.2, that would be very helpful information for us.

@google-oss-bot
Copy link
Contributor

Hey @jamesdaniels. 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!

@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@jamesdaniels 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.

@firebase firebase locked and limited conversation to collaborators Dec 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants