Skip to content

doctor: detect wrong app dependencies #1848

Open
@cortinico

Description

@cortinico

Describe the Feature

I'd like to propose a feature for doctor that will ideally make life easier for users when upgrading RN versions: detect erroneous top level package.

Essentially inside the app package.json file in the dependencies/devDependencies block, we should inspect for packages which are known to be incompatible (an alternative could be to inspect the yarn.lock).

Packages you should not have in your app package.json are:

A more relaxed way to check for those depedencies is to verify if they're compatible with the RN version (so for instance react-native 0.71.x works only with react-native-codegen version 0.71.x and so on).

In general, there is no reason why a user should directly depend on a package like react-native/@gradle-plugin. What happens is that users find a (generally wrong) workaround somewhere on Github/StackOverflow, and this dependency ends up in their package.json causing future react-native version upgrades to fail badly.

Related Issues

See here for a build failure generated by wrong codegen version:
facebook/react-native#36286 (comment)

See here for a build failure generated by wrong gradle plugin version:
facebook/react-native#36198 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions