Skip to content

Can't build project on React Native + Metro #469

Answered by vegidio
vegidio asked this question in Q&A
Discussion options

You must be logged in to vote

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#670

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 metro.config.js to resolve the module from another path, like this:

resolver: {
    resolveRequest: (context, moduleName, platform) => {
        if (moduleName.startsWith('graphql-request')) {
            return {
                filePath: `${__dirname}/n…

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ismay
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jasonkuhrt
Comment options

Answer selected by jasonkuhrt
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants
Converted from issue

This discussion was converted from issue #468 on March 05, 2023 20:25.