react
react copied to clipboard
Bug: Since React 19 release my React 18 builds with npm ci are failing
As soon as React 19 was published on December 5, 2024 approx 4:05PM EST, all my builds for React 18 (18.3.1) in my CICD pipeline are failing with Linting and Types errors raised from when yarn build is building my Next JS v 14.0.4 app.
React version: 18.3.1
Before the release, I was able to build my React 18 app without issue, I was building dozens per day. As soon as the React 19 was published it all broke. Any reason for this? I have React 18.3.1 locked in my package.json, my dependency versions are all the same. Did something change with React 18.3.1 version?
I think it maybe has to do with the package "@types/[email protected]"
Or perhaps npm isn't resolving @types/react": "*" in package-lock.json to a consistent version anymore ever since some release today.
npm was resolving fine up until today's release. Something changed today.
I had to downgrade my React to 18.2.x and specify resolutions in my package.json so that dependencies like react-syntax-highlighter work:
"resolutions": {
"react": "18.2.0",
"react-dom": "18.2.0",
"@types/react": "18.2.45",
"@types/react-dom": "18.2.18"
}
This wasn't necessary before today's React 19 release
Packages published from DT unfortunately list * as the dependency range. We're in the process of migrating away from it but in the meantime, use resolutions or ideally a lockfile since any type release could potentially break your pipeline.
I had to downgrade my React to 18.2.x and specify
resolutionsin my package.json so that dependencies likereact-syntax-highlighterwork:"resolutions": { "react": "18.2.0", "react-dom": "18.2.0", "@types/react": "18.2.45", "@types/react-dom": "18.2.18" }This wasn't necessary before today's React 19 release
Thank you, been banging my head against the same problem. This fixed my build.