Closed jasonswearingen closed 8 years ago
I'm also seeing this issue, even on v3.0.0.
I asked for some help in the discord channel and was directed to try the following:
const LogMonitor = require('redux-devtools-log-monitor').default;
const DockMonitor = require('redux-devtools-dock-monitor').default;
Since I was using commonJS modules instead of ES6. including the 'default' enabled my monitors to render and for the errors to stop.
Hi Awalkerca, I'm also using commonjs. Thank you for that info, changing to use .default
fixed it for me too.
We had the same issue in remote-redux-devtools as here with export from
. A solution would be like this.
If it helps anyone in the future, here is a gist of a single file example for redux-simple-router + redux-devtools v3
https://gist.github.com/jasonswearingen/44068ebe04b1b077c8c9
it's Typescript, but easy enough to ignore the typings.
https://github.com/gaearon/redux-devtools/issues/223#issuecomment-170600130 is the correct solution. We are going with ES6 semantics so CommonJS consumers now need to add .default
to get default exports.
maybe you can encapsulate the thrown exception with something more user friendly? to explain to commonjs users why it went boom and how to fix.
Yes, a PR to provide a good error message would be most welcome!
given that I can't even find where this code is located (due to your build system?) I won't be able to. Maybe can add it as a low-priority todo the next time the main contributors make changes.
I'm not sure what problem is with the build system, but the code is in src
folder.
Relevant line is here.
What you'll likely want to check is that Monitor
is a function (= valid React component), and if not, throw an error right away. Bonus points for checking whether it has a .default
field—in this case you can specifically mention that CommonJS consumers need to use .default
.
I'm trying to follow a basic example (the one on the main readme.md file) to get the 3.x of ReduxDevTools working (i got 2.x working fine)
but I'm getting a thrown exception on the
return Monitor.update(....
line bellow:_createDevTools.js_
strange I tried finding this code on the
v3.0.1
tag in github but it's not there ??? something about your build system I suppose....Any suggestions about what I might be doing wrong?
Here is my code related to creating the devtools, it throws the exception on the last line.