You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to MobX. Please provide as much relevant information as possible!
Hi, I'm trying to do what this code does: https://github.com/meteor-space/tracker-mobx-autorun/blob/master/observe-cursor.js
This used to work fine with MobX 2.x version. I'm trying to bridge between MeteorJS's Trackr to Mobx by clone the code above. I've only bumped up the MobX version to the latest 3.1.2 without further changes. I'm getting this error below, even though the observable modification is clearly wrapped by an action. I've tried to do some debugging myself, and found that
in this function:
function checkIfStateModificationsAreAllowed(atom) {
var hasObservers = atom.observers.length > 0;
if (globalState.computationDepth > 0 && hasObservers)
fail(getMessage("m031") + atom.name);
if (!globalState.allowStateChanges && hasObservers)
-->> fail(getMessage(globalState.strictMode ? "m030a" : "m030b") + atom.name);
}
globalState.allowStateChanges will always be false. Without too much of the internal knowledge of MobX. I can't proceed any further.
Welcome to MobX. Please provide as much relevant information as possible!
Hi, I'm trying to do what this code does:
https://github.com/meteor-space/tracker-mobx-autorun/blob/master/observe-cursor.js
This used to work fine with MobX 2.x version. I'm trying to bridge between MeteorJS's Trackr to Mobx by clone the code above. I've only bumped up the MobX version to the latest 3.1.2 without further changes. I'm getting this error below, even though the observable modification is clearly wrapped by an action. I've tried to do some debugging myself, and found that
in this function:
function checkIfStateModificationsAreAllowed(atom) {
var hasObservers = atom.observers.length > 0;
if (globalState.computationDepth > 0 && hasObservers)
fail(getMessage("m031") + atom.name);
if (!globalState.allowStateChanges && hasObservers)
-->> fail(getMessage(globalState.strictMode ? "m030a" : "m030b") + atom.name);
}
globalState.allowStateChanges will always be false. Without too much of the internal knowledge of MobX. I can't proceed any further.
Exception in queued task: Error: [mobx] Invariant failed: Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an
action
if this change is intended. Tried to modify: ContactsState@3._contactsat invariant (eval at (http://localhost:3500/assets/web.js:846:2), :2715:15)
at fail (eval at (http://localhost:3500/assets/web.js:846:2), :2710:5)
at checkIfStateModificationsAreAllowed (eval at (http://localhost:3500/assets/web.js:846:2), :989:9)
at ObservableArrayAdministration.spliceWithArray (eval at (http://localhost:3500/assets/web.js:846:2), :1646:9)
at ObservableArray.splice (eval at (http://localhost:3500/assets/web.js:846:2), :1793:27)
at Object. (http://localhost:3000/packages/bananacloud_tracker-mobx-autorun.js?hash=fed5878c2c6a58579ec1dec60e5122ef936d4659:169:25)
at executeAction (http://localhost:3000/packages/modules.js?hash=01e91f6793dd58f999b0889352b4035cce995c71:31446:19)
at Object.res [as addedAt] (http://localhost:3000/packages/modules.js?hash=01e91f6793dd58f999b0889352b4035cce995c71:31437:16)
at LocalCollection._CachingChangeObserver.addedBefore (http://localhost:3000/packages/minimongo.js?hash=68d94baf766fd5bcc86fc44a6758779727eb60f8:3549:28)
at Object.addedBefore (http://localhost:3000/packages/minimongo.js?hash=68d94baf766fd5bcc86fc44a6758779727eb60f8:3484:56)
versions:
Meteor: 1.4
Node: v4.7.3
Browser: Any (I'm using Chrome)
MobX: 3.1.2
I have a*:
Please tick the appropriate boxes. Feel free to remove the other sections.
The text was updated successfully, but these errors were encountered: