Skip to content

React: Peer dependency error with React 19 #282

Open
@martinliptak

Description

@martinliptak

I've been following Installation (React) to add Modular Forms into a new React Router 7.1 project with React 19.

npm install @modular-forms/react
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: dependencies@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^19.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.14.0 || 17.x || 18.x" from @preact/[email protected]
npm ERR! node_modules/@preact/signals-react
npm ERR!   peer @preact/signals-react@"^1.0.0" from @modular-forms/[email protected]
npm ERR!   node_modules/@modular-forms/react
npm ERR!     @modular-forms/react@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

I think the problem is caused by @modular-forms/react depending on @preact/signals-react version 1 which requires react lower than 19. Solution should be upgrading the @preact/signals-react peer dependency to version 2 or 3. Or is there another way around it?

This is related to #188 and #191

And thanks for this awesome library! I've read the docs, really like its type-safe API design and can't wait to try it out.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions