`theme-mermaid`: `tooltipElem.transition is not a function` when hovering flowchart nodes

Aperta
#12,938 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

  • #1 di @TbhVishal — chiusa senza merge

Valutazione

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

Direzione di ricerca

Start by reading the @docusaurus/theme-mermaid integration and its Mermaid dependency setup; the report points to Mermaid's flowchart hover behavior and the missing transition method. Reproduce with the provided flowchart, then trace how Mermaid and D3 transitions are loaded. Done when hovering flowchart nodes produces no runtime error.

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

Descrizione

bug status: needs triage
Have you read the Contributing Guidelines on issues?
Prerequisites
  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).
Description

With @docusaurus/theme-mermaid, hovering nodes in a Mermaid flowchart throws:

TypeError: tooltipElem.transition is not a function
    at SVGGElement.eval (webpack-internal:///./node_modules/mermaid/dist/chunks/mermaid.core/chunk-*.mjs)
    at SVGGElement.eval (webpack-internal:///./node_modules/d3-selection/dist/d3-selection.mjs:777:14)

The diagram renders correctly. The diagram defines no click or tooltip directives.

Reproducible demo

No response

Steps to reproduce
  1. Add the config above.

  2. Add a .md doc containing this flowchart:

    ```mermaid
    flowchart LR
        A[Start] --> B[Process]
        B --> C{Decision}
        C -->|Yes| D[Done]
        C -->|No| B
    `` ` // <- space to support nested code fence
    
  3. Run yarn docusaurus clear && yarn start.

  4. Open the page and hover over the nodes.

[!NOTE]
I have tried both CodeSandbox and StackBlitz; both gave separate unrelated errors trying to reproduce this - please understand, I am not a Node/JS/Frontend developer, none of this is my stack.

Expected behavior

No runtime error.

Actual behavior

The dev server error overlay shows tooltipElem.transition is not a function.

Your environment
  • @docusaurus/core: 3.10.2
  • @docusaurus/theme-mermaid: 3.10.2
  • mermaid: 12.3.0 (also reproduced with 12.2.0 and 11.17.2)
  • d3: 7.9.2, d3-selection: 3.0.1, d3-transition: 3.0.2 (one installed copy of each)
  • Package manager: yarn 1.22.22
  • OS: macOS
  • Node:
  • Browser:
Self-service
  • I'd be willing to fix this bug myself.
Lingua principale
TypeScript
Stelle
66.6k
Fork
10.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 facebook/docusaurus

Tutte le issue di facebook/docusaurus

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.