Skip to content

Compatibility: node packages depending on V8 can't function in react-native iOS #5881

@ambarc

Description

@ambarc

I'm building a react-native app to go across Android and iOS. I'm noticing some dependencies in libraries I'm using depend on having a V8 (node) runtime. This breaks the JavaScriptCore JS runtime on iOS, with RN error-ing with something like:

Requiring unknown module _moduleA_. If you are sure the module is there try restarting the packager.

What I'm noticing is that v8 requiring moduleA doesn't get copied over in the react bundle that gets placed on the phone. I found this by logging the modules present in

node_modules/react-native/packager/react-packager/src/Resolver/polyfills/require.js

Since I don't own the libraries that I'm trying to use I can't modify the dependency.

In my case I'm trying to use the twilio module which uses Node's crypto module.

I'm guessing I won't face this issue when I build RN on Android.

What are the options like?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions