zalmoxisus / remote-redux-devtools

Redux DevTools remotely.
http://zalmoxisus.github.io/monitoring/
MIT License
1.8k stars 138 forks source link

Unknown named module: 'crypto' #60

Closed Chapurin closed 7 years ago

Chapurin commented 7 years ago

E/ReactNativeJS: Unknown named module: 'crypto' When i do import import devToolsEnhancer from 'remote-redux-devtools';

zalmoxisus commented 7 years ago

Could you please provide a stacktrace? We're not using such module, it should be from some dependencies. Are you running it on Windows 10?

HJ29 commented 7 years ago

I have the same problem and yes, I run it on Windows 10.

zalmoxisus commented 7 years ago

@HJ29, what version of React Native you're using? Could you please try to downgrade to remote-redux-devtools@0.5.1.

ALWAL12 commented 7 years ago

Ironically, I don't know how to copy the stack trace from my emulator, so I took 3 pictures. :)

We don't have the problem here on Mac, but we do on Windows 10 for everyone (in my team). I tried downgrading the version to 0.5.1, but it does not seem to solve the problem.

stack trace-1 stack trace-2 stack trace-3

zalmoxisus commented 7 years ago

@ALWAL12, thanks for the stack trace. I see it is from shortid (from here). It was included in remote-redux-devtools@0.5.5 (in https://github.com/zalmoxisus/remote-redux-devtools/commit/de93b51ab0e218b66b8cefc7b159ee838cd21d11 and https://github.com/zalmoxisus/remotedev-utils/pull/3), so an earlier version should work.

cc @jhen0409

ALWAL12 commented 7 years ago

Probably a cache error from my own. I'll downgrade temporary. Thank you for the feedback.

jhen0409 commented 7 years ago

shortid have a fallback for browser (browser field of package.json), and it works for me on React Native. @ALWAL12 could you provide your React Native version?

zalmoxisus commented 7 years ago

@jhen0409, it seems to happen only on Windows as in #39.

ALWAL12 commented 7 years ago

We use the latest version of React-Native, so 0.39 for now. And we had the issue #39 as well.

HJ29 commented 7 years ago

I'm using the latest version of react native, downgrade to remote-redux-devtools@0.5.1 make it work.

sofwu commented 7 years ago

@jhen0409 I get the same error between NR 0.38~0.39 only on windows, when ever there is nothing wrong on Mac.

zalmoxisus commented 7 years ago

It is related to https://github.com/facebook/react-native/issues/9570. It was fixed in https://github.com/facebook/react-native/commit/4647b62f4de9f41ade680bbb90da7d11e2c79547, which is available in react-native@0.40.0-rc.4.

Not sure we should wait for react-native@0.40.0 release, encourage to use remote-redux-devtools@0.5.1 for windows, or downgrade socketcluster-client and remotedev-utils for now.

jhen0409 commented 7 years ago

@zalmoxisus looks like this problem isn't resolved, the https://github.com/facebook/react-native/issues/9572 should already land on 0.34-stable. I think move the issue to react-native will be better.

downgrade socketcluster-client and remotedev-utils for now.

For remotedev-utils, replace shortid will be better for older RN versions, or revert https://github.com/zalmoxisus/remote-redux-devtools/commit/de93b51ab0e218b66b8cefc7b159ee838cd21d11.

zalmoxisus commented 7 years ago

@jhen0409, according to the tag, it was merged just in v0.40.0-rc.4 not in 0.34.

jhen0409 commented 7 years ago

@zalmoxisus I think the tag is meaning included the commit of branches:

2016-12-23 9 52 15

so it should already in v0.34.0-rc.0, v0.40 should only release nearly two weeks of changes.

zalmoxisus commented 7 years ago

@jhen0409 thanks for the clarification. Weird. Then I don't see how uuid's browser field (which should be supported) is different from shortid one.

jhen0409 commented 7 years ago

I open the PR https://github.com/facebook/react-native/pull/11641, @zalmoxisus it's why uuid worked but shortid not. 😂

zalmoxisus commented 7 years ago

@jhen0409 that's a great catch! 😃 Thanks for addressing it!

BolexLiu commented 7 years ago

@zalmoxisus To solve the schedule?

zalmoxisus commented 7 years ago

@BolexLiu, thanks to @jhen0409, this bug is already fixed in React Native, and it should work on react-native@0.40.0-rc.6. If you want to support earlier versions, use remote-redux-devtools@0.5.1.

BolexLiu commented 7 years ago

@zalmoxisus thank you. But I was doing the same on 0.5.1 and now I'm going to try and clean up the cache to see if it works

zalmoxisus commented 7 years ago

react-native@0.41.0 is out, which includes @jhen0409's fix. Added also a note that you should use remote-redux-devtools@0.5.0 on Windows for earlier versions support.