Installing Page Constructor with React 19 adds a nested ReactDOM 18

Aperta
#1,504 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
40/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

The fix is in the library's dependency ranges: @react-spring/web, react-slick and react-monaco-editor in its package.json. Reproduce with a React 19 app, then run npm ls react-dom --all and npm install --strict-peer-deps to see the duplicate ReactDOM 18 and the react-final-form and react-waypoint conflicts. Done when a React 19 install shows only react-dom@19 and the remaining peer conflicts are documented or resolved.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

@gravity-ui/page-constructor declares React 19 support, but installing it in a React 19 application adds [email protected] alongside the consumer's react-dom@19.

Multiple ReactDOM runtimes can cause renderer mismatches and runtime problems with contexts, portals, and hooks.

Reproduction

StackBlitz

The reproduction uses:

{
  "dependencies": {
    "@diplodoc/transform": "4.57.1",
    "@gravity-ui/page-constructor": "8.20.1",
    "@gravity-ui/uikit": "7.48.3",
    "react": "19.2.8",
    "react-dom": "19.2.8"
  }
}

Run:

npm ls react-dom --all

The resulting tree contains two ReactDOM major versions. The relevant part is:

+-- @gravity-ui/[email protected]
| +-- @react-spring/[email protected]
| | `-- [email protected]
| `-- [email protected]
|   `-- [email protected] deduped
`-- [email protected]
Full StackBlitz output
~/projects/vitejs-vite-mvg2qy7r
❯ npm ls react-dom --all
[email protected] /home/projects/vitejs-vite-mvg2qy7r
+-- @gravity-ui/[email protected]
| +-- @gravity-ui/[email protected]
| | `-- [email protected] deduped
| +-- @gravity-ui/[email protected]
| | +-- @gravity-ui/[email protected]
| | | `-- [email protected] deduped
| | `-- [email protected] deduped
| +-- @react-spring/[email protected]
| | `-- [email protected]
| +-- [email protected]
| | `-- [email protected] deduped
| `-- [email protected]
|   `-- [email protected] deduped
+-- @gravity-ui/[email protected]
| +-- @floating-ui/[email protected]
| | +-- @floating-ui/[email protected]
| | | `-- [email protected] deduped
| | `-- [email protected] deduped
| +-- @hello-pangea/[email protected]
| | `-- [email protected] deduped
| +-- @tanstack/[email protected]
| | `-- [email protected] deduped
| +-- @uiw/[email protected]
| | +-- @uiw/[email protected]
| | | +-- @uiw/[email protected]
| | | | `-- [email protected] deduped
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | +-- @uiw/[email protected]
| | | `-- [email protected] deduped
| | `-- [email protected] deduped
| +-- [email protected]
| | +-- [email protected]
| | | `-- [email protected] deduped
| | `-- [email protected] deduped
| +-- [email protected] deduped
| +-- [email protected]
| | `-- [email protected] deduped
| `-- [email protected]
|   `-- [email protected] deduped
`-- [email protected]

Strict peer dependency enforcement also fails because the dependency tree contains additional React 19-incompatible peers. The first reported conflict is [email protected]:

npm install --strict-peer-deps
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error While resolving: [email protected]
npm error Could not resolve dependency:
npm error peer react@"^16.8.0 || ^17.0.0 || ^18.0.0" from [email protected]
Full npm install --strict-peer-deps output
~/projects/vitejs-vite-mvg2qy7r
❯ npm install --strict-peer-deps
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/react
npm error   react@"^19.2.8" from the root project
npm error   peerOptional react@"^16.8.0  || ^17.0.0 || ^18.0.0 || ^19.0.0" from @diplodoc/[email protected]
npm error   node_modules/@diplodoc/cut-extension
npm error     @diplodoc/cut-extension@"^0.7.2" from @diplodoc/[email protected]
npm error     node_modules/@diplodoc/transform
npm error       @diplodoc/transform@"4.57.1" from the root project
npm error       1 more (@gravity-ui/page-constructor)
npm error   41 more (@diplodoc/tabs-extension, @diplodoc/utils, ...)
npm error
npm error Could not resolve dependency:
npm error peer react@"^16.8.0 || ^17.0.0 || ^18.0.0" from [email protected]
npm error node_modules/react-final-form
npm error   peer react-final-form@"^6.5.3" from @gravity-ui/[email protected]
npm error   node_modules/@gravity-ui/dynamic-forms
npm error     @gravity-ui/dynamic-forms@"^5.0.0" from @gravity-ui/[email protected]
npm error     node_modules/@gravity-ui/page-constructor
npm error       @gravity-ui/page-constructor@"8.20.1" from the root project
npm error   react-final-form@"^6.5.9" from @gravity-ui/[email protected]
npm error   node_modules/@gravity-ui/page-constructor
npm error     @gravity-ui/page-constructor@"8.20.1" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/react
npm error   peer react@"^16.8.0 || ^17.0.0 || ^18.0.0" from [email protected]
npm error   node_modules/react-final-form
npm error     peer react-final-form@"^6.5.3" from @gravity-ui/[email protected]
npm error     node_modules/@gravity-ui/dynamic-forms
npm error       @gravity-ui/dynamic-forms@"^5.0.0" from @gravity-ui/[email protected]
npm error       node_modules/@gravity-ui/page-constructor
npm error         @gravity-ui/page-constructor@"8.20.1" from the root project
npm error     react-final-form@"^6.5.9" from @gravity-ui/[email protected]
npm error     node_modules/@gravity-ui/page-constructor
npm error       @gravity-ui/page-constructor@"8.20.1" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --no-strict-peer-deps, --force, or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/.npm/_logs/2026-08-31T12_46_35_044Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/.npm/_logs/2026-08-31T12_46_35_044Z-debug-0.log

Expected behavior

All Page Constructor dependencies should reuse the consumer's ReactDOM version. A React 19 application should contain only react-dom@19.

Additional findings

The installed versions of @react-spring/web and react-slick only declare support up to ReactDOM 18. There are also React 19 peer conflicts in react-monaco-editor, react-final-form, and react-waypoint.

For reference, I tested newer versions of several dependencies:

Dependency Installed by Page Constructor Tested version
@react-spring/web ^9.7.3 ^10.1.2
react-slick ^0.29.0 ^0.31.0
react-monaco-editor ^0.53.0 ^0.59.0

With these versions, React Spring and React Slick reuse the consumer's ReactDOM 19 instead of installing ReactDOM 18. React Monaco Editor also no longer reports its previous React 19 peer conflict.

This does not resolve every React 19 peer conflict. The tested installation still reports conflicts involving:

Lingua principale
TypeScript
Stelle
65
Fork
27
Merge medio
4g 19h
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di gravity-ui/page-constructor

Tutte le issue di gravity-ui/page-constructor

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.