synergycodes/ng-diagram/ng-diagram-troubleshooting

Claude Code and agent skill by synergycodes/ng-diagram

Trust tier 3
  • community
  • ext:[{"type":"context","description":"Custom context provider definitions"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when something in an ng-diagram app is broken and the cause is unclear - an [ngDiagram] console warning or error, edges not drawn, changes or events that do nothing, timing problems. Triage, console message index, symptom router.

Install

npx vskill@latest install synergycodes/ng-diagram/ng-diagram-troubleshooting

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

Troubleshooting ng-diagram

Start from a symptom or a console message: run the first checks, find the symptom below, then open the skill that owns the fix. Every message the library can print is in references/console-messages.md; bugs fixed by an upgrade are in references/upgrade-fixes.md.

Rules

  • Check the installed version first (node_modules/ng-diagram/package.json or the lockfile). Many symptoms are bugs fixed in 1.2–1.4; compare with "Fixed in a later version" below.
  • Copy the exact console text and search references/console-messages.md for it. Most library messages start with [ngDiagram]; for a multi-line message, search its first line.
  • Go through "First checks" before deep debugging. Most reports are one of them.
  • Confirm every API name in node_modules/ng-diagram/ng-diagram.d.ts before you suggest code. Some docs pages and older examples do not compile against 1.4.0.
  • Never "fix" by writing system-owned fields (measuredPorts, measuredBounds, measuredLabels, computedZIndex, computedHidden, sourcePosition/targetPosition of connected ends, points of auto-routed edges, size of auto-sized nodes). The library recomputes them and your value is lost.
  • Never hide nodes, edges, ports or the diagram with CSS display: none. Hidden elements measure 0 × 0, initialization waits 2 to 4 seconds and logs measurement timeouts. Use the hidden flag or inputs (ng-diagram-visibility).

First checks

Check these in order; each line says how to see it quickly.

  1. Global styles. getComputedStyle(document.documentElement).getPropertyValue('--ngd-node-border-radius') is empty when ng-diagram/styles.css is not imported in the global stylesheet. → ng-diagram-setup
  2. `provideNgDiagram()` scope. It must be in providers of the component that renders <ng-diagram> (or an ancestor), and every component or service that injects an ng-diagram service must sit below it. Otherwise: NgDiagram services are not available… or NG0201 / NullInjectorError. → ng-diagram-setup
  3. Container size. <ng-diagram> is 100% of its parent; a parent without a height shows nothing and logs nothing. Look at the element's height in DevTools. → ng-diagram-setup
  4. One model per diagram. Create it once with initializeModel() (custom adapters: initializeModelAdapter()). Re-creating it re-initializes the diagram; binding a model again after its diagram was destroyed gives an empty, frozen diagram. → ng-diagram-model-init, ng-diagram-persistence
  5. No calls before init. Service calls in the host's constructor or ngOnInit, or a toolbar that binds canZoomIn(), throw [ngDiagram] Library engine not initialized yet. Move them into (diagramInit) or guard with isInitialized(). → ng-diagram-model-init
  6. Runtime config. <ng-diagram> reads [config] (except the watermark keys) and [middlewares] only when a model is initialized. At runtime use NgDiagramService.updateConfig() and registerMiddleware(); a few keys are read only at engine start even then (ng-diagram-config).
  7. Await, then read with getters. After await on a service call, getNodeById(), getEdgeById() and getModel() are fresh; the nodes() / edges() / metadata() signals refresh with change detection and can lag, also in event handlers. → ng-diagram-state-updates
  8. Nothing hidden with CSS. display: none on nodes, ports, labels or a parent of the diagram (an inactive tab, a collapsed panel) shows as Measurement timeout reached warnings and a diagram that appears after 2 to 4 seconds. → ng-diagram-visibility
  9. Port ids. sourcePort / targetPort must name a port that the node template renders (the default node has port-left and port-right). A wrong id draws nothing and logs nothing; compare with getNodeById(id)?.measuredPorts?.map((p) => p.id). → ng-diagram-ports
  10. Only the background goes inside `<ng-diagram>`. It projects <ng-diagram-background> and nothing else; a minimap, toolbar or overlay placed inside is not rendered. Put them next to it in a position: relative wrapper. → ng-diagram-setup, ng-diagram-minimap

Symptom router

The owning skill has the full table for its area.

Setup and rendering
SymptomLikely causeSkill
Empty area, nothing visible, no errorParent of <ng-diagram> has no heightng-diagram-setup
Unstyled boxes, CSS variables do nothingstyles.css missing or imported in a componentng-diagram-setup, ng-diagram-styling
`NgDiagram services are not available. Please register all required services using provideNgDiagram() …`No provideNgDiagram() above <ng-diagram>ng-diagram-setup
NullInjectorError / NG0201 for an ng-diagram service in a toolbar, sidebar, palette or minimapThat code is outside the provideNgDiagram() treeng-diagram-setup
Two diagrams interfere, or one turns emptyBoth share one provideNgDiagram()ng-diagram-setup
[ngDiagram] Node template '<type>' is not registered…type does not match a key of [nodeTemplateMap]ng-diagram-custom-nodes
[ngDiagram] Edge template '<type>' is not registered…type does not match a key of [edgeTemplateMap]ng-diagram-custom-edges
Initialization and timing
SymptomLikely causeSkill
[ngDiagram] Library engine not initialized yet.Service call before <ng-diagram> created its engine, or after it was destroyedng-diagram-model-init
Diagram appears after 2 to 4 s; [InitUpdater] / [DiagramInitEmitter] Measurement timeout reachedElements or a container hidden with CSS at load, or model not from initializeModel()ng-diagram-model-init, ng-diagram-visibility
NG0203 effect() can only be used within an injection context from initializeModelCalled after await, in a handler or in computed; pass the injectorng-diagram-model-init
(diagramInit) does not fire after "reloading"Same model object bound again, or events disabled before initng-diagram-model-init
Diagram empty or frozen after an @if, tab or route brings it backIts model was destroyed with the old diagramng-diagram-model-init
Nodes added right after loading a new model disappearThey went to the old model; add them in (diagramInit)ng-diagram-model-init
Middlewares, routings, listeners or updateConfig changes gone after loading another modelA new model means a new engine; re-apply after (diagramInit)ng-diagram-model-init, ng-diagram-config
Changing the object bound to [config] does nothingRead only at model init; use updateConfig()ng-diagram-config
Model updates and state
SymptomLikely causeSkill
nodes() / selection() shows old data after await or in an event handlerSignals refresh with change detection; use getters or the event payloadng-diagram-state-updates
Other data fields disappear after updateNodeDatadata is replaced, not mergedng-diagram-state-updates
An update does nothingSame mutated object passed back, unknown id, or a middleware cancelled itng-diagram-state-updates
await on a service call never resolves; the diagram stops changingA middleware never calls next()/cancel() or awaits a mutating callng-diagram-middleware
Middleware <name> already registered / executed next() multiple timesName registered twice / next() called on two pathsng-diagram-middleware
A nested transaction outlived its parent… / waitForMeasurements is ignored…Un-awaited overlapping transactions / option inside a transactionng-diagram-transactions
Group children gone after deleteNodes([groupId])Expected since 1.4.0; removeFromGroup firstng-diagram-groups
Ctrl/Cmd+Z logs Undo is not implemented in the current model…The default model has no historyng-diagram-persistence
Nodes, ports and measurement
SymptomLikely causeSkill
Cannot draw an edge from or to a nodeNo <ng-diagram-port>, wrong port type, or the port is hiddenng-diagram-ports
Port positions stale after a class toggle or style changeCSS-only moves are not observed; await invalidateMeasurements()ng-diagram-ports
size ignored or overwrittenautoSize is true; set autoSize: falseng-diagram-custom-nodes
Typing in an input inside a node drags the node or pansAdd data-no-drag="true" / data-no-pan="true"ng-diagram-custom-nodes
Selection highlight invisible on a custom nodeHost is display: inlineng-diagram-custom-nodes, ng-diagram-styling
No resize or rotate handlesAdornment missing, node not selected or rotated, or disabledng-diagram-resize-rotate-snap
Snapping does nothingThe shouldSnap… callbacks return false by defaultng-diagram-resize-rotate-snap
A node does not join a group on dropGroup lacks isGroup: true, or canGroup returned falseng-diagram-groups
Edges and linking
SymptomLikely causeSkill
Edge not drawn, no errorWrong port id, port not measured, manual edge without points, or hiddenng-diagram-edge-routing
[ngDiagram] Invalid edge coordinates detected for edge '<id>'Missing node, free end without position, or invalid pointsng-diagram-edge-routing, ng-diagram-dangling-edges
[ngDiagram] Edge routing '<name>' is not registered…Routing registered too late or misspelledng-diagram-edge-routing
Edges hidden behind nodesDefault z-order; zIndex.edgesAboveConnectedNodes: trueng-diagram-layering
Drawn edges use the default template or routingSet type / routing in finalEdgeDataBuilderng-diagram-linking
Pressing a port starts no drawTarget-only or hidden port, or another draw or relink runsng-diagram-linking
Edges created twice after enabling dangling edgesAn edgeDrawEnded handler adds an edge on noTargetng-diagram-dangling-edges
No relink handles on a selected edge, or a node covers themNot relinkable, no routed path yet, or zIndex elevation turned offng-diagram-edge-relinking
event.source.id fails to compile after upgrading to 1.4.0EdgeDrawEndedEvent.source is optionalng-diagram-linking
Interaction and events
SymptomLikely causeSkill
No keyboard shortcut worksFocus is outside the diagramng-diagram-shortcuts
All default shortcuts gone after customizingshortcuts replaced as a plain array; use configureShortcuts()ng-diagram-shortcuts
(output) handlers stopped firingremoveAllEventListeners() or events disabledng-diagram-events
[ngDiagram] Event listener error: Listener for "<event>"…Your addEventListener callback threwng-diagram-events
selectionRemoved never fires for a delete buttonIt fires only for the Delete/Backspace key, deleteSelection() and cut()ng-diagram-events
Toolbar opens on mouse down or flickersUse selectionGestureEnded, not selectionChangedng-diagram-events
Browser menu appears over a custom context menupreventDefault() ran after an awaitng-diagram-selection-clipboard
Box selection does nothing on a tabletHold still for 400 ms, then dragng-diagram-touch
[ngDiagram] Invalid drop data… or a node created from a file dropSomething that is not a palette item was droppedng-diagram-palette
Viewport and export

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
583
Repository forks
41
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • contextCustom context provider definitions

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/synergycodes/ng-diagram/ng-diagram-troubleshooting/badge)](https://verified-skill.com/skills/synergycodes/ng-diagram/ng-diagram-troubleshooting)

Something wrong with this skill or its page? Tell us.