js: React Native SDK broken. Unable to resolve "thirdweb/pay" from "node_modules/@thirdweb-dev/sdk/dist/thirdweb-dev-sdk.cjs.dev.js"

If I try installing adding react-native sdk, either in a bare react-native project or in an expo project I get the following error. The error happens as soon as you add ThirdWebProvider component to your app.

ERROR  [Error: undefined Unable to resolve module thirdweb/pay from /Users/jon/repos/github.com/jrhe/thirdweb_bare_react_native_test/node_modules/@thirdweb-dev/sdk/dist/thirdweb-dev-sdk.cjs.prod.js: thirdweb/pay could not be found within the project or in these directories:
  node_modules/@thirdweb-dev/sdk/node_modules
  node_modules
  111 | require('uuid');
  112 | require('thirdweb');
> 113 | require('thirdweb/pay');
      |          ^
  114 | require('thirdweb/utils');
  115 | require('fast-deep-equal');
  116 | require('./marketplace-bc46f8c3.cjs.prod.js');]

There are also other users on discord having this issue: https://discord.com/channels/834227967404146718/1229386961018425444

I have tried different versions of expo, thirdweb’s packages, and react-native without luck.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 32 (8 by maintainers)

Most upvoted comments

hey all, we’ve been hard at work making v5 work in react native projects.

We’ve got it mostly working, just working on docs now and putting in the last finishing touches.

will post the docs links here as soon as they’re up

Latest release is out V5.23.0 now works with react native with the additional @thirdweb-dev/react-native-adapter and a few other dependencies.

Appart from installation, everything works the same as on the web with the same imports.

Docs: https://portal.thirdweb.com/typescript/v5/react-native

Demo repo: https://github.com/thirdweb-example/expo-starter

Let us know what you think!

we released a patch 0.8.0 of the @thirdweb-dev/react-native package which should resolve this issue - can you all confirm?

In the meantime, we’re working on a completely revamped react native package based on the v5 typescript/react web SDK, will be more performant and much lighter than the current one - stay tuned for updates!

Don’t think so @theweb3kid . Until this bug is resolved, there doesn’t seem to be any way to make thirdweb work with React Native.

Hi @jnsdls, I have tried to downgrade to older version but i don’t know why it still has the same issue.

can you try deleting your node_modules and reinstalling? most likely you have ended up with a cached dependency of some sort


We’re targeting a minimal version of the react-native overhaul (first version) by end of this week or early next week. It will likely come with less pre-configured wallet support out of the box initially (since the wallet libraries are (mostly) the things that force us into bad DX (having to eject out of expo, installing tens of polyfills etc)

Also getting this error when building on android: Cannot locate tasks that match ‘:coinbase-wallet-mobile-sdk:assembleDebug’ as project ‘coinbase-wallet-mobile-sdk’ not found in root project.

The V5 SDK does not have/use Coinbase wallet SDK yet. Might need to remove it from your project

We’re targeting a minimal version of the react-native overhaul (first version) by end of this week or early next week. It will likely come with less pre-configured wallet support out of the box initially (since the wallet libraries are (mostly) the things that force us into bad DX (having to eject out of expo, installing tens of polyfills etc)

Is there any update on this? I only need inApp wallet and smart wallet support.

Hay Guys are you still facing this issue if you got it please share

I will be trying a few more versions and try to track it down

@thirdweb-dev/react-native@0.73.1 does not exist. I did try 0.7.31 but it still has the same issue. Or I may have not cleaned, deleted builds and stuff enough? Though I did verify that is the package being used

Yeah I also think there maybe some mistake here, I have tried 0.7.31 -> 0.5.xx but it still has the same error, also tried to create a new React Native Project form scratch too but still the same.

Hi @jnsdls, I have tried to downgrade to older version but i don’t know why it still has the same issue.