-
DescriptionTrying to use
Reproduction Steps/Repo LinkThe project can be found here: |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
After some investigation it seems that the problem is caused by the lack of a After I edited the package.json file in the "node_modules/graphql-request/" and I added the property
Can the |
Beta Was this translation helpful? Give feedback.
-
@vegidio Moving this to a discussion since right now there is no issue to act on and it is not a bug with the library. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response. I'm in favor of letting the deprecated stuff die, but I'm not sure what old things I might be using. If you look at the repo that I linked before, this is a fresh React Native project created just 18 days ago so it's supposedly using the newest version. Do you have any idea what old thing could be causing this problem so I can report to the correct maintainer to suggest an upgrade? |
Beta Was this translation helpful? Give feedback.
-
Ok, so I pinged the React Native + Metro maintainers and it turns out I just wanted to get that clarified before we continue because some people could get confused with the previous message that the current tools already support this, which is not the case yet. Meanwhile, there's a workaround for this problem. People with the same issue can update their resolver: {
resolveRequest: (context, moduleName, platform) => {
if (moduleName.startsWith('graphql-request')) {
return {
filePath: `${__dirname}/node_modules/graphql-request/build/esm/index.js`,
type: 'sourceFile',
};
}
return context.resolveRequest(context, moduleName, platform);
},
}, Full example available in my project @jasonkuhrt I would suggest to maybe include the workaround above in the package's README.md file (the same way the React Navigation folks did for a similar problem) to help other developers that are having the same problem using |
Beta Was this translation helpful? Give feedback.
-
Related #526 (comment) |
Beta Was this translation helpful? Give feedback.
Ok, so I pinged the React Native + Metro maintainers and it turns out
exports
are not supported yet by them, but they are working on it: facebook/metro#670I just wanted to get that clarified before we continue because some people could get confused with the previous message that the current tools already support this, which is not the case yet.
Meanwhile, there's a workaround for this problem. People with the same issue can update their
metro.config.js
to resolve the module from another path, like this: