-
Notifications
You must be signed in to change notification settings - Fork 204
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
OID4VC holder module not starting in RN environment #1943
Comments
Thanks for reporting! I've had some other reports on similar issue. I think we have to handle imports for Node.JS specific modules a bit differently. It's weird that it somehow works in Expo, but not in bare React Native. BTW -- I do recommend to upgrade the Bifold app to Expo, as it's now also the recommended way to manage a project (you don't have to use Expo cloud services to use the open source expo framework): https://reactnative.dev/blog/2024/06/25/use-a-framework-to-build-react-native-apps. We will update the documentation to reflect this as well (however we will keep supporting bare React Native applications of course) |
Upgrading Bifold to Expo is a whole community dilemma since Bifold now is officially the underlying engine for some publicly used wallets in many different orgs and different countries. The other issue is that we do utilize bridges in android/iOS to harness some core system features that are not available out of the box in RN packages such as biometry security policies to detect changes .. etc |
All these things are possible with Expo, expo is a layer on top of React Native that makes it simpler to use. It's like using Next.JS for a React project, instead of React. I think in the long run, expo will make it a lot easier for those orgs, as expo provides easy APIs to generate and modify any part of the application using Expo Modules and Config Plugins |
I had issues with getting |
Perhaps just a problem when running in web mode?
|
I can see that the package has the following dependencies
Those are Node packages and I see the reason since the holder which Is meant to run on a device (React Native) is packaged along with the issuer and verifier which is meant to run on Node enviroment |
Yes that is correct @MosCD3, but we import express dynamically:
But appereantly the bundler for React Native doesn't play well with this. I think what we have to do is to have a |
Could you try in your node_modules copy |
I was able to reproduce this in our Expo app as well now. So I'm not sure what changed as we've been using this for quite a while, but something about the loader / bundler must have changed causing this. |
Opened #1946 to fix it |
this solution worked |
Hi Team
I am trying to add support for OID4VC to Bifold which runs on React Native. As the docs said, out of the box, the holder module is supported on RN. Installing deps should be as straight forward as adding
"@credo-ts/openid4vc": "0.5.3",
to the dependencies. That was not the case, at first I got an error
serve-static couldn't be found in node modules.
I then installed serve-static. Now am getting this error when initializing the module
any thoughts?
The text was updated successfully, but these errors were encountered: