Skip to content

Missing peer dependency on react-dom #1424

Closed
@pieh

Description

@pieh

This package import some utilities from react-dom:

export { unstable_batchedUpdates } from 'react-dom'

But react-dom is not specified as dependency or peerDependency

react-redux/package.json

Lines 38 to 49 in 2297944

"peerDependencies": {
"react": "^16.8.3",
"redux": "^2.0.0 || ^3.0.0 || ^4.0.0-0"
},
"dependencies": {
"@babel/runtime": "^7.5.5",
"hoist-non-react-statics": "^3.3.0",
"invariant": "^2.2.4",
"loose-envify": "^1.4.0",
"prop-types": "^15.7.2",
"react-is": "^16.9.0"
},

This cause Cannot file module 'react-dom' errors when using it with Ink (react for cli/terminal).

Installing react-dom does fix the issue (bit weird to install it for terminal app, but what can you do :) ). If react-dom is being used, it should be either dependency (probably not the way here) or peerDependency so package managers warn about missing dependency before we run into issues like that.

Issue discovered in gatsbyjs/gatsby#18603

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions