-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Observable map cannot be replace with another observable map #1258
Comments
Ai, this seems to be an oversight indeed. Would you be interested to create
a PR? Thanks!
Op ma 27 nov. 2017 om 12:04 schreef Petar Petrov <[email protected]>:
… Since MobX v3.3.2 an observable map cannot be replaced with another
observable map. I believe the only supported types are plain object, plain
array and ES6 Map.
*Error: [mobx] Invariant failed: Cannot get keys from ObservableMap@*
Most probably related to:
Issue: #1243 <#1243>
MR: #1247 <#1247>
The *getMapLikeKeys* util function in #1247
<#1247> does not take into account
MobX maps. I think the *isES6Map* check must be replaced with *isMapLike*
check which matches both ES6 Maps and MobX maps.
1. Issue
-
*Provide error messages including stacktrace*
Uncaught (in promise) Error: [mobx] Invariant failed: Cannot get keys
from ***@***.***[{ }]
at invariant (webpack-internal:///43:2372)
at fail (webpack-internal:///43:2367)
at getMapLikeKeys (webpack-internal:///43:2570)
at eval (webpack-internal:///43:2287)
at transaction (webpack-internal:///43:2068)
at ObservableMap.replace (webpack-internal:///43:2283)
-
Provide a *minimal* sample reproduction.
const items = mobx.observable.map();
items.replace(mobx.observable.map())
-
Did you check this issue wasn't filed before?
I couldn't find a similar issue
-
Elaborate on your issue. What behavior did you expect?
MobX observable maps should be also supported for replacement (was
working before v3.3.2)
-
State the versions of MobX and relevant libraries. Which browser /
node / ... version?
The issue is reproducible with MobX v3.3.2 only
-
Do you think others will benefit from this change as well and it
should in core package (see also mobx-utils)?
This scenario was working before v3.3.2 so...
-
Are you willing to (attempt) a PR yourself?
I don't have a setup to build/test MobX but I would be glad to try
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1258>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhKx3oq0sLk3rty-GXFHREZ1KMzTrks5s6pdTgaJpZM4Qrdrf>
.
|
Sure :) |
Fix released as 3.3.3. Thanks! |
Thanks for the fix and sorry for the delay! It was a busy week and I did not have time to prepare the PR. Maybe next time :) |
Cool! Looking forward :)
Op di 5 dec. 2017 om 07:50 schreef Petar Petrov <[email protected]>:
… Thanks for the fix and sorry for the delay! It was a busy week and I did
not have time to prepare the PR. Maybe next time :)
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1258 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhPC8zI2s4a05uKABPjVvam_ebk3dks5s9OfLgaJpZM4Qrdrf>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since MobX v3.3.2 an observable map cannot be replaced with another observable map. I believe the only supported types are plain object, plain array and ES6 Map.
Error: [mobx] Invariant failed: Cannot get keys from ObservableMap@
Most probably related to:
Issue: #1243
MR: #1247
The getMapLikeKeys util function in #1247 does not take into account MobX maps. I think the isES6Map check must be replaced with isMapLike check which matches both ES6 Maps and MobX maps.
Provide error messages including stacktrace
Uncaught (in promise) Error: [mobx] Invariant failed: Cannot get keys from ObservableMap@71[{ }]
at invariant (webpack-internal:///43:2372)
at fail (webpack-internal:///43:2367)
at getMapLikeKeys (webpack-internal:///43:2570)
at eval (webpack-internal:///43:2287)
at transaction (webpack-internal:///43:2068)
at ObservableMap.replace (webpack-internal:///43:2283)
Provide a minimal sample reproduction.
Did you check this issue wasn't filed before?
I couldn't find a similar issue
Elaborate on your issue. What behavior did you expect?
MobX observable maps should be also supported for replacement (was working before v3.3.2)
State the versions of MobX and relevant libraries. Which browser / node / ... version?
The issue is reproducible with MobX v3.3.2 only
Do you think others will benefit from this change as well and it should in core package (see also mobx-utils)?
This scenario was working before v3.3.2 so...
Are you willing to (attempt) a PR yourself?
I don't have a setup to build/test MobX but I would be glad to try
The text was updated successfully, but these errors were encountered: