facebook / fbt

A JavaScript Internationalization Framework
https://facebook.github.io/fbt
MIT License
3.88k stars 178 forks source link

React 18 support #372

Closed TJ09 closed 2 years ago

TJ09 commented 2 years ago

🐛 Bug Report

According to npm, fbt declares a peer dependency on react that ranges from 0.12.0 - 17.x.x. This means it is not possible to adopt React 18 in a project that uses FBT, though in my own testing, forcing npm to install conflicting versions seems to work just fine anyway.

To Reproduce

$ npm init
...
$ npm i react@18.0
$ npm i fbt

Expected behavior

fbt is installed successfully.

Actual behavior

$ npm i react@18.0

added 3 packages, and audited 4 packages in 817ms

found 0 vulnerabilities
$ npm i fbt
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: test@1.0.0
npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR!   react@"18.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"0.12.0 - 17.x.x" from fbt@1.0.0
npm ERR! node_modules/fbt
npm ERR!   fbt@"*" 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.

envinfo

  Binaries:
    Node: 16.16.0 - /usr/bin/node
    npm: 8.11.0 - /usr/bin/npm
    Watchman: 20220605.192726.0 - /usr/local/bin/watchman