Skip to content

I was able to get this working but with one additional step #2

@nickwelp

Description

@nickwelp

After following the steps in the guide, I had this error:
`/MyApp/node_modules/react-native-codegen/lib/parsers/flow/index.js:220
const regex = new RegExp(TURBO_MODULE_REGISTRY_REQUIRE_REGEX_STRING, 'g');
^

SyntaxError: Invalid regular expression: /TurboModuleRegistry\s*.\sget(Enforcing)?\s<\sSpec\s>\s*(\s*'"['"]\s*,?\s*)/: Invalid group
Command PhaseScriptExecution failed with a nonzero exit code`

I found a solution, by following this advice facebook/react-native#31180

I added
"resolutions": { "react-native-codegen": "^0.0.7" },
to my package.json, deleted package-lock.json, rm -rf ./node_modules/react-native-codegen, then used yarn to install, which honors resolutions, installing only versions of packages as specified. This got around an issue react-native-codegen 0.0.6 has, which is imported by some other libraries

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions