-
Notifications
You must be signed in to change notification settings - Fork 15
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
Version 0.5.4 of @wry/equality is causing my react-native build to fail #483
Comments
Thanks for reporting this @awatt-cox! Does this workaround work? Specifically, the advice about putting this code in your const { getDefaultConfig } = require("metro-config");
const { resolver: defaultResolver } = getDefaultConfig.getDefaultValues();
exports.resolver = {
...defaultResolver,
sourceExts: [...defaultResolver.sourceExts, "cjs"],
}; If that workaround helps, then I believe this is a known React Native problem, since the Metro bundler is refusing to use a file with a Since facebook/metro#535 has finally been fixed/closed, it sounds like the React Native team agrees it was their problem to fix, though you'll have to wait for v0.72.0 for an automatic fix. |
Related Apollo Client issues/PRs:
That PR apollographql/apollo-client#9716 reminds me of another solution we eventually came up with for Apollo Client, which I will try to apply here as well. |
Thanks for the tip (and the quick response to my issue). After following some of the links you posted, I updated my metro.config.js and it fixed the issue. Here's my final config code:
|
Great, thanks for confirming my suspicions! Since that workaround worked, I implemented a more robust solution that should make the I've published those changes in |
I have a react-native project that uses @apollo/client version 3.6.9. Apollo client has a subdependency:
"@wry/equality": "^0.5.0",
Yesterday, we started having build failures with the error shown below. I looked into the issue and found that @wry/equality version 0.5.4 causes the failure. If I roll my package-lock file back to use @wry/equality 0.5.3, the issues disappear. I tried updating @apollo/client to the latest version and the problem was the same (@wry/equality 0.5.3 works, 0.5.4 fails). Please take a look at your latest build.
Thanks!
error: Error: While trying to resolve module
@wry/equality
from file/Users/Awatt/Desktop/_PROJECTS/manheim_mobile_new/manheim_mobile_native/node_modules/@apollo/client/core/core.cjs.native.js
, the package/Users/Awatt/Desktop/_PROJECTS/manheim_mobile_new/manheim_mobile_native/node_modules/@wry/equality/package.json
was successfully found. However, this package itself specifies amain
module field that could not be resolved (/Users/Awatt/Desktop/_PROJECTS/manheim_mobile_new/manheim_mobile_native/node_modules/@wry/equality/lib/bundle.cjs
. Indeed, none of these files exist:at DependencyGraph.resolveDependency (/Users/Awatt/Desktop/_PROJECTS/manheim_mobile_new/manheim_mobile_native/node_modules/metro/src/node-haste/DependencyGraph.js:311:17)
at Object.resolve (/Users/Awatt/Desktop/_PROJECTS/manheim_mobile_new/manheim_mobile_native/node_modules/metro/src/lib/transformHelpers.js:129:24)
at resolve (/Users/Awatt/Desktop/_PROJECTS/manheim_mobile_new/manheim_mobile_native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:33)
at /Users/Awatt/Desktop/_PROJECTS/manheim_mobile_new/manheim_mobile_native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:412:26
at Array.reduce ()
at resolveDependencies (/Users/Awatt/Desktop/_PROJECTS/manheim_mobile_new/manheim_mobile_native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:411:33)
at processModule (/Users/Awatt/Desktop/_PROJECTS/manheim_mobile_new/manheim_mobile_native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:140:31)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async addDependency (/Users/Awatt/Desktop/_PROJECTS/manheim_mobile_new/manheim_mobile_native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:230:18)
at async Promise.all (index 0)
The text was updated successfully, but these errors were encountered: