Skip to content
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

Prevents build from completing in React Native #5

Open
amlord opened this issue Aug 23, 2024 · 2 comments
Open

Prevents build from completing in React Native #5

amlord opened this issue Aug 23, 2024 · 2 comments

Comments

@amlord
Copy link

amlord commented Aug 23, 2024

Hi @tniessen,

This probably isn't something unexpected, as it's not a standard node environment, but just wanted to record it here in case it's functionality you'd like to support.

I've been busy packaging up this lib, and found that this package causes the build to fail in React Native for iOS (I haven't yet tried Android). The issue disappears if I comment out the code in this catch block: https://github.com/tniessen/node-pqclean/blob/main/index.js#L7

This then causes the object properties to not be set, an functionality to not be available.

React Native doesn't come with support for wasm out of the box (it looks like there are some recent packages that might help with this, although I haven't tried them yet).

As the repo is a wrapper around the C libs, there might be a straightforward fix, although C to JS bindings come outside of my current area of expertise.

For now, I'm falling back to another package for React Native, and keeping pqclean for use in Node so it's not a blocker for me.

Kind regards,
Andrew

@tniessen
Copy link
Owner

Thanks for opening an issue @amlord. Could you please share the error messages and any other relevant you are seeing?

I am not familiar with React Native for iOS but the preferred solution would be to build and bundle the native addon that node-pqclean builds for Linux, macOS, and Windows. I am not sure if React Native/iOS supports this.

The WebAssembly implementation is a backup solution for Deno, web browsers, etc.

@amlord
Copy link
Author

amlord commented Aug 23, 2024

The error message I get is "PhaseScriptExecution failed with a nonzero exit code", which happens when bundling the JS code during the build phase.

It's a fairly generic message, and doesn't provide any more info than that I'm afraid.

I've had similar issues in the past, and we've got around them by implementing the code causing the issue in rust and building binaries for use the various environments we support (Linux, Mac, iOS, Android).

I can certainly push a basic RN app example to git, although, if you're not familiar with RN & iOS development, I'm not sure it'd help much?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants