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
2 changes: 1 addition & 1 deletion smo-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"react-dom": "^18.2.0",
"react-error-boundary": "^6.0.0",
"react-i18next": "^16.2.3",
"react-leaflet": "^4.2.1",
"react-leaflet": "^5.0.0",
Copy link

Choose a reason for hiding this comment

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

Bug: Updating react-leaflet to ^5.0.0 without upgrading React to v19 creates a peer dependency conflict.
Severity: CRITICAL | Confidence: High

πŸ” Detailed Analysis

The react-leaflet package was updated to ^5.0.0, which requires React v19 as a peer dependency. However, the project's package.json still specifies "react": "^18.2.0". This version mismatch will lead to module resolution failures, hook incompatibility errors, and runtime crashes when react-leaflet v5 components and hooks (like useMap) attempt to interact with React v18's incompatible internal APIs.

πŸ’‘ Suggested Fix

Upgrade React to v19.0.0 or higher to satisfy react-leaflet v5's peer dependency requirements, or revert react-leaflet to a v4.x.x version compatible with React v18.

πŸ€– Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: smo-frontend/package.json#L38

Potential issue: The `react-leaflet` package was updated to `^5.0.0`, which requires
React v19 as a peer dependency. However, the project's `package.json` still specifies
`"react": "^18.2.0"`. This version mismatch will lead to module resolution failures,
hook incompatibility errors, and runtime crashes when `react-leaflet v5` components and
hooks (like `useMap`) attempt to interact with React v18's incompatible internal APIs.

Did we get this right? πŸ‘ / πŸ‘Ž to inform future reviews.
Reference ID: 4768886

"react-leaflet-custom-control": "^1.4.0",
"react-window": "^1.8.11",
"rxjs": "^7.8.2",
Expand Down
12 changes: 12 additions & 0 deletions smo-frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,11 @@
resolved "https://registry.yarnpkg.com/@react-leaflet/core/-/core-2.1.0.tgz#383acd31259d7c9ae8fb1b02d5e18fe613c2a13d"
integrity sha512-Qk7Pfu8BSarKGqILj4x7bCSZ1pjuAPZ+qmRwH5S7mDS91VSbVVsJSrW4qA+GPrro8t69gFYVMWb1Zc4yFmPiVg==

"@react-leaflet/core@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@react-leaflet/core/-/core-3.0.0.tgz#34ccc280ce7d8ac5c09f2b3d5fffded450bdf1a2"
integrity sha512-3EWmekh4Nz+pGcr+xjf0KNyYfC3U2JjnkWsh0zcqaexYqmmB5ZhH37kz41JXGmKzpaMZCnPofBBm64i+YrEvGQ==

"@rolldown/[email protected]":
version "1.0.0-beta.47"
resolved "https://registry.yarnpkg.com/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.47.tgz#c282c4a8c39f3d6d2f1086aae09a34e6241f7a50"
Expand Down Expand Up @@ -5747,6 +5752,13 @@ react-leaflet@^4.2.1:
dependencies:
"@react-leaflet/core" "^2.1.0"

react-leaflet@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/react-leaflet/-/react-leaflet-5.0.0.tgz#945d40bad13b69e8606278b19446b00bab57376a"
integrity sha512-CWbTpr5vcHw5bt9i4zSlPEVQdTVcML390TjeDG0cK59z1ylexpqC6M1PJFjV8jD7CF+ACBFsLIDs6DRMoLEofw==
dependencies:
"@react-leaflet/core" "^3.0.0"

react-refresh@^0.18.0:
version "0.18.0"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.18.0.tgz#2dce97f4fe932a4d8142fa1630e475c1729c8062"
Expand Down
Loading