Closed steveluscher closed 2 years ago
@steveluscher interesting, I'd be down for a PR if you want to make this change!
For sure. I would have done that in the moment, but I had too much mental stack to switch. If I get to it first, cool; if someone reading this wants to take a crack at it, cooler!
PR'd.
Hi everyone, thanks very much for addressing this! I was having this issue using solana/web3.js and stumbled upon this. I downloaded @steveluscher's branch and tested it out locally and it was able to build.
Awesome! Let's shipit!
Hi @steveluscher
I'm experiencing the exact same problem:
iOS Bundling failed 409ms While trying to resolve module superstruct from file...
I have installed your branch yarn add git+https://github.com/steveluscher/superstruct.git#react-native-compatibility
but still get the same error.
Do you by any chance know if there's some additional configuration to do/link me to your "Getting Started" README ?
Thanks a lot in advance!
@valentinmadrid the package needs to be built, it can't be cloned directly from git. not sure if this is the right way, but i used the same yarn add ...
as you, but then also cloned steve's branch to a separate location. in that directory, i ran yarn install && yarn build
. this produced a directory named lib
. i copied that lib
directory to my project's node_modules/superstruct/
directory.
this seems to have worked but i immediately ran into other issues. i don't think they're related though.
We'll just have to be patient! Once @ianstormtaylor mashes the merge button on #1086 and does a release, we should all be able to update to that new release from npm.
Hi @ianstormtaylor, we have run into the same issue and really expect a new release of superstruct to address this. Thanks heaps!
Guys any resolution, i'm facing exactly same error:
"react-native": "0.69.6",
"@solana/web3.js": "1.66.1"
Thanks for this but i'm on "@solana/web3.js": "1.66.1"
with react-native: "0.69.6"
I know! You’ll have to upgrade to 0.70+ for support going forward. We’ve abandoned the 0.69- line.
Importing @solana/web3.js in React Native throws the following error.
You can see that the React Native packager expects a
.js
extension in addition to.cjs
If
superstruct
could rename the CommonJS bundles from.cjs
to.cjs.js
that would make it Just Work™ for React Native folks!More details on the problem here, if you're interested: https://github.com/facebook/metro/issues/535