-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined is not a function (evaluating 'babelHelpers.typeof(obj)') using nes library #8074
Comments
Seems the nes module is pre-compiled with babel using the es2015 preset.React Native uses a different babelHelpers file which might be causing issues. The only workaround I know as of now is to fork React Native and replace it's babelHelpers file with a standard babelHelpers file as documented here -
I had this issue with one of our own modules earlier and ended up switching that module to use the The proper fix will be to add the ability to specify a babelHelpers file to react-native packager. PRs are welcome. |
Well, I ended using this solution and it works perfectly. |
Awesome. I had actually used that solution in past, but it broke with RN upgrade. |
I got a similar error multiple times while I was starting with react-native on the last 2 days. First I previously add a development section in my babel conf where es2015 where using, so boom. Took me a while to understand that, even with all those errors. After that, (I now launch Having this I am still new with react-native, but I saw that some times, errors are caught and displayed with nice explanations (like when using react/react-dom - which is a good thing). Don't you think this generic error could be caught and enhanced to prevent people wasting time on this, like I just did for a couple of hours? |
@MoOx It seems like a good idea to add an extra warning when this happens. Interested in sending a pull request? ;-) Otherwise, it seems like this is an issue with a known workaround, rather than an outstanding bug, so I am going to close this issue. I think the right fix is to stop transpiling npm modules but for now there are workarounds. |
Hey there!
I'm trying to use nes library with react-native with no success.
I included nes in a fresh react-native project like this:
But I'm getting the following error:
And after trying to add nes in one or another way I came out with this:
If I modify the file
nes/dist/client.js
like this:Everything works perfectly, But I can't totally understand with running
_typeof({});
throws the same error as the image above.Also, if I open the remote debugger (with the above "solution") get the following error:
package.json
index.android.js
The text was updated successfully, but these errors were encountered: