zalmoxisus / mobx-remotedev

MobX DevTools extension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

examples/counter not works

HaveF opened this issue Β· comments

commented
  1. Install chrome extension

  2. use examples/counter, not works

  3. 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]

2016-10-02 8 10 21

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).

commented

Thanks for your explanation. I see, these examples are for dev purpose.

Yes, but they are indeed confusing, so I've just fixed them in dd8b833.