Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dompurify": "3.3.1",
"jszip": "3.10.1",
"lucide-react": "0.575.0",
"react": "18.3.1",
"react": "19.2.4",
"react-dom": "18.3.1",
Comment on lines +16 to 17
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat package.json

Repository: Sethispr/image-compressor

Length of output: 648


🌐 Web query:

React 19 react-dom peer dependency requirements compatibility

💡 Result:

  • react-dom’s peer dependency on react is version-locked to the same patch line. For example, react-dom@19.2.1 declares peerDependencies: { react: "^19.2.1" }, so it expects react to be 19.2.1+ within the 19.2.x range, not 19.0.x or 19.1.x. [1]
  • At runtime, React 19 enforces that react and react-dom are the exact same version. If they differ (even by patch), you can hit an “Incompatible React versions” error. [2]
  • Practical compatibility rule for React 19: always install/upgrade react and react-dom together to the same version (same major/minor/patch), as the official upgrade guide shows installing them in tandem. [3]
  • Ecosystem note: many third‑party packages may still block React 19 via their own peer dependency ranges (e.g., only allowing React 18), which is separate from the React/ReactDOM pairing requirement. [4]

Sources:
[1] react-dom package.json diff showing peerDependencies (react: ^19.2.1) (npmdiff.dev)
[2] react-dom server code enforcing exact version match (npmdiff.dev)
[3] React 19 Upgrade Guide install instructions (id.react.dev)
[4] Example discussion of React 19 peer-dep ecosystem lag (sanity.io)

Citations:


Align react-dom with React 19 to avoid version mismatch and runtime errors.

React 19 enforces exact version matching between react and react-dom; mismatched versions cause "Incompatible React versions" runtime errors. Bump react-dom to 19.2.4 and add @types/react/@types/react-dom ^19 (required since the project uses TypeScript).

🔧 Proposed fix
   "dependencies": {
     "clsx": "2.1.1",
     "dompurify": "3.3.1",
     "jszip": "3.10.1",
     "lucide-react": "0.563.0",
     "react": "19.2.4",
-    "react-dom": "18.3.1",
+    "react-dom": "19.2.4",
     "uuid": "13.0.0"
   },
   "devDependencies": {
     "@types/dompurify": "^3.2.0",
+    "@types/react": "^19.0.0",
+    "@types/react-dom": "^19.0.0",
     "@types/node": "^25.0.10",
     "@vitejs/plugin-react": "^5.1.2",
     "gts": "^7.0.0",
     "typescript": "^5.2.0",
     "vite": "^7.3.1"
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"react": "19.2.4",
"react-dom": "18.3.1",
"dependencies": {
"clsx": "2.1.1",
"dompurify": "3.3.1",
"jszip": "3.10.1",
"lucide-react": "0.563.0",
"react": "19.2.4",
"react-dom": "19.2.4",
"uuid": "13.0.0"
},
"devDependencies": {
"@types/dompurify": "^3.2.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@types/node": "^25.0.10",
"@vitejs/plugin-react": "^5.1.2",
"gts": "^7.0.0",
"typescript": "^5.2.0",
"vite": "^7.3.1"
}
🤖 Prompt for AI Agents
In `@package.json` around lines 16 - 17, Update package dependencies to align
React and its type packages: change the react-dom dependency to match react's
version ("react-dom": "19.2.4") and add TypeScript type packages "@types/react"
and "@types/react-dom" with a compatible semver (e.g., ^19) to package.json;
ensure any lockfile is updated (run install) so react and react-dom versions are
exact matches and TypeScript picks up the correct types.

"uuid": "13.0.0"
},
Expand Down