examples/counter not works
HaveF opened this issue Β· comments
HaveF commented
-
Install chrome extension
-
use examples/counter, not works
-
update examples/counter/package.json
- "mobx-remotedev": "^0.0.1", + "mobx-remotedev": "^0.2.2",
- "jsdom": "^5.6.1", - "mocha": "^2.2.5", - "node-libs-browser": "^0.5.2", + "jsdom": "^9.5.0", + "mocha": "^3.1.0", + "node-libs-browser": "^1.0.0",
still not works. The browser is blank.
No error at terminal:
β counter git:(master) β npm start
> redux-counter-example@0.0.0 start /Users/HaveF/Desktop/mobx/mobx-remotedev/examples/counter
> node server.js
==> π Listening on port 4001. Open up http://localhost:4001/ in your browser.
webpack built d6f57debc790c97f8f46 in 3999ms
error at browser console:
Uncaught Error: [mobx] Invariant failed: Cannot obtain atom from [object Object]
Mihail Diordiev commented
Thanks for the report. I know the examples are confusing.
You should change
import remotedev from '../../../src/dev'; // import remotedev from 'mobx-remotedev/lib/dev';
to
import remotedev from 'mobx-remotedev/lib/dev';
in this line.
You get that error message because the appState
and mobx-remotedev
use 2 different mobx instances (one from the examples/counter/node_package
and another one from node_package
).
HaveF commented
Thanks for your explanation. I see, these examples are for dev purpose.
Mihail Diordiev commented
Yes, but they are indeed confusing, so I've just fixed them in dd8b833.