Skip to content

Dependency react-text-mask doesn't work with React 17 #297

@felix-last

Description

@felix-last

When installing mson-react in our React 17-dependent application, npm raises ERESOLVE:

npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!   peer react@"^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" from mini-create-react-context@0.4.1
npm ERR!   node_modules/mini-create-react-context
npm ERR!     mini-create-react-context@"^0.4.0" from react-router@5.2.0
npm ERR!     node_modules/react-router
npm ERR!       react-router@"5.2.0" from react-router-dom@5.2.0
npm ERR!       node_modules/react-router-dom
npm ERR!         react-router-dom@"^5.2.0" from the root project
npm ERR!         1 more (mson-react)
npm ERR!   22 more (prop-types-extra, react-bootstrap, react-dom, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from react-text-mask@5.4.3
npm ERR! node_modules/mson-react/node_modules/react-text-mask
npm ERR!   react-text-mask@"^5.4.3" from mson-react@1.11.0
npm ERR!   node_modules/mson-react
npm ERR!     mson-react@"^1.11.0" from the root project

It seems that the peer dependency of react-text-mask is breaking compatibility with react 17. The issue is tracked on react-text-mask, with a merge request ready, but it doesn't seem to get merged: text-mask/text-mask#1045

Moreover, react-text-mask appears to be deprecated and unmaintained. Perhaps mson-react should use one of the alternatives proposed by the project:

⚠️ This library is not maintained. Pull-requests and issues are not monitored. Alternatives to text-mask include:

https://github.com/uNmAnNeR/imaskjs
https://github.com/JsDaddy/ngx-mask

Workaround:
Install with --legacy-peer-deps to ignore peer dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions