Skip to content
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

RXJS6 Cannot read property '_id' of undefined #111

Closed
dottodot opened this issue May 26, 2018 · 5 comments · Fixed by #113
Closed

RXJS6 Cannot read property '_id' of undefined #111

dottodot opened this issue May 26, 2018 · 5 comments · Fixed by #113

Comments

@dottodot
Copy link

Whilst testing the rxjs6 version I keep getting the following error, which I don't get on the rxjs5 version.

It only happens when doing the following...

For example view blog post (get post), edit post (patch post), return to view post (get post) is where the error is thrown.

order-detail.component.ts:52 TypeError: Cannot read property '_id' of undefined
    at filterFn (resource.js:31)
    at FilterSubscriber.push.../../node_modules/rxjs/_esm5/internal/operators/filter.js.FilterSubscriber._next (filter.js:78)
    at FilterSubscriber.push.../../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:93)
    at MergeMapSubscriber.push.../../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber.notifyNext (mergeMap.js:136)
    at InnerSubscriber.push.../../node_modules/rxjs/_esm5/internal/InnerSubscriber.js.InnerSubscriber._next (InnerSubscriber.js:20)
    at InnerSubscriber.push.../../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:93)
    at MapSubscriber.push.../../node_modules/rxjs/_esm5/internal/operators/map.js.MapSubscriber._next (map.js:81)
    at MapSubscriber.push.../../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:93)
    at Socket.handler (fromEvent.js:135)
    at Socket.push.../../node_modules/component-emitter/index.js.Emitter.emit (index.js:133)
@dottodot
Copy link
Author

It seems to relate to

 const filterFn = current => current[options.idField] === data[options.idField];

as current is always undefined

@j2L4e
Copy link
Collaborator

j2L4e commented May 26, 2018

on thing that really bums me out with rxjs is the stacktraces. Think we're not mapping event data properly in index.js#32-35.

See ReactiveX/rxjs@51b37fd#diff-540ecaa405456292d10f27d705b5fcd6

If there are multiple args, they will be passed as an array. If there's one, it's passed plain...

@j2L4e
Copy link
Collaborator

j2L4e commented May 26, 2018

I can't reproduce this, can you add a test case?

@j2L4e
Copy link
Collaborator

j2L4e commented May 26, 2018

@dottodot

Can you reinstall from the rxjs6-dist branch?

Changes: bcb7a28

This should solve it. While a local event emission contains the context object as a second argument, I'd expect an event received via websockets not to.

@dottodot
Copy link
Author

Yeah the error message isn't the most helpful, anyway that update has resolved the issue.

@j2L4e j2L4e mentioned this issue May 26, 2018
daffl pushed a commit that referenced this issue May 26, 2018
* migrate to rxjs6

* fix imports for typings

* cosmetics...

* use fromEvent result selector, add comment re: result selector deprecation

* fix linting
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

Successfully merging a pull request may close this issue.

2 participants