aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
15.85k stars 554 forks source link

React <18 does not work due to react-reconciler dependency #1062

Open mattrunyon opened 1 week ago

mattrunyon commented 1 week ago

What version of million are you using?

1.0.0-rc.26

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Linux

What browser are you using?

Chrome

Describe the Bug

Tried installing @million/lint with a Vite project running React 17.0.2. Can't start anything with errors about trying to import react-dom/client.

react-reconciler has a peer dep for react ^18.3.1. This causes it to be installed by npm in node_modules/@million/lint/node_modules/react. The code to detect the React version looks like it checks via import { version } from 'react' which will resolve to the react version installed by the react-reconciler peer dependency, not the version in the workspace.

Not sure if this is an npm issue only, but the default behavior of npm 7+ is to install peer dependencies that are unmet. So it's expected behavior from npm based on the packages.

What's the expected result?

@million/lint working with React 16.8 - 17 when using npm

Link to Minimal Reproducible Example

https://stackblitz.com/edit/vitejs-vite-xfzbac?file=package.json

Participation

github-actions[bot] commented 1 week ago

Thanks for opening this issue! A maintainer will review it soon.

ogi-joo commented 3 days ago

Any update on this?

mountEvarus commented 2 days ago

@ogi-joo if this helps, reverting to 1.0.0-rc.18 seems to solve the issue for me for the time being

bingoYB commented 1 day ago

@ogi-joo if this helps, reverting to 1.0.0-rc.18 seems to solve the issue for me for the time being

When I switched to 1.0.0-rc.18, a new issue occurred 😢 image

ogi-joo commented 1 day ago

@mountEvarus @bingoYB Well I don't use million, but another package which also has problem with react-reconciler.

I use React 19 RC and it doesn't work. Only when I downgrade. I think this is similar problem to mine.

So there has to be some workaround or we wait for react-reconciler patch? Idk