synergycodes/ng-diagram/ng-diagram-troubleshooting
Claude Code and agent skill by synergycodes/ng-diagram
- community
- ext:[{"type":"context","description":"Custom context provider definitions"}]
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-troubleshootingSemi-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.jsonor 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.mdfor 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.tsbefore 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/targetPositionof connected ends,pointsof auto-routed edges,sizeof 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 thehiddenflag or inputs (ng-diagram-visibility).
First checks
Check these in order; each line says how to see it quickly.
- Global styles.
getComputedStyle(document.documentElement).getPropertyValue('--ngd-node-border-radius')is empty whenng-diagram/styles.cssis not imported in the global stylesheet. →ng-diagram-setup - `provideNgDiagram()` scope. It must be in
providersof 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…orNG0201/NullInjectorError. →ng-diagram-setup - 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 - 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 - No calls before init. Service calls in the host's constructor or
ngOnInit, or a toolbar that bindscanZoomIn(), throw[ngDiagram] Library engine not initialized yet.Move them into(diagramInit)or guard withisInitialized(). →ng-diagram-model-init - Runtime config.
<ng-diagram>reads[config](except the watermark keys) and[middlewares]only when a model is initialized. At runtime useNgDiagramService.updateConfig()andregisterMiddleware(); a few keys are read only at engine start even then (ng-diagram-config). - Await, then read with getters. After
awaiton a service call,getNodeById(),getEdgeById()andgetModel()are fresh; thenodes()/edges()/metadata()signals refresh with change detection and can lag, also in event handlers. →ng-diagram-state-updates - Nothing hidden with CSS.
display: noneon nodes, ports, labels or a parent of the diagram (an inactive tab, a collapsed panel) shows asMeasurement timeout reachedwarnings and a diagram that appears after 2 to 4 seconds. →ng-diagram-visibility - Port ids.
sourcePort/targetPortmust name a port that the node template renders (the default node hasport-leftandport-right). A wrong id draws nothing and logs nothing; compare withgetNodeById(id)?.measuredPorts?.map((p) => p.id). →ng-diagram-ports - 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 aposition: relativewrapper. →ng-diagram-setup,ng-diagram-minimap
Symptom router
The owning skill has the full table for its area.
Setup and rendering
| Symptom | Likely cause | Skill | |
|---|---|---|---|
| Empty area, nothing visible, no error | Parent of <ng-diagram> has no height | ng-diagram-setup | |
| Unstyled boxes, CSS variables do nothing | styles.css missing or imported in a component | ng-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 minimap | That code is outside the provideNgDiagram() tree | ng-diagram-setup | |
| Two diagrams interfere, or one turns empty | Both 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
| Symptom | Likely cause | Skill | |
|---|---|---|---|
[ngDiagram] Library engine not initialized yet. | Service call before <ng-diagram> created its engine, or after it was destroyed | ng-diagram-model-init | |
Diagram appears after 2 to 4 s; [InitUpdater] / [DiagramInitEmitter] Measurement timeout reached | Elements 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 initializeModel | Called after await, in a handler or in computed; pass the injector | ng-diagram-model-init | |
(diagramInit) does not fire after "reloading" | Same model object bound again, or events disabled before init | ng-diagram-model-init | |
Diagram empty or frozen after an @if, tab or route brings it back | Its model was destroyed with the old diagram | ng-diagram-model-init | |
| Nodes added right after loading a new model disappear | They went to the old model; add them in (diagramInit) | ng-diagram-model-init | |
Middlewares, routings, listeners or updateConfig changes gone after loading another model | A new model means a new engine; re-apply after (diagramInit) | ng-diagram-model-init, ng-diagram-config | |
Changing the object bound to [config] does nothing | Read only at model init; use updateConfig() | ng-diagram-config |
Model updates and state
| Symptom | Likely cause | Skill | |
|---|---|---|---|
nodes() / selection() shows old data after await or in an event handler | Signals refresh with change detection; use getters or the event payload | ng-diagram-state-updates | |
Other data fields disappear after updateNodeData | data is replaced, not merged | ng-diagram-state-updates | |
| An update does nothing | Same mutated object passed back, unknown id, or a middleware cancelled it | ng-diagram-state-updates | |
await on a service call never resolves; the diagram stops changing | A middleware never calls next()/cancel() or awaits a mutating call | ng-diagram-middleware | |
Middleware <name> already registered / executed next() multiple times | Name registered twice / next() called on two paths | ng-diagram-middleware | |
A nested transaction outlived its parent… / waitForMeasurements is ignored… | Un-awaited overlapping transactions / option inside a transaction | ng-diagram-transactions | |
Group children gone after deleteNodes([groupId]) | Expected since 1.4.0; removeFromGroup first | ng-diagram-groups | |
Ctrl/Cmd+Z logs Undo is not implemented in the current model… | The default model has no history | ng-diagram-persistence |
Nodes, ports and measurement
| Symptom | Likely cause | Skill | |
|---|---|---|---|
| Cannot draw an edge from or to a node | No <ng-diagram-port>, wrong port type, or the port is hidden | ng-diagram-ports | |
| Port positions stale after a class toggle or style change | CSS-only moves are not observed; await invalidateMeasurements() | ng-diagram-ports | |
size ignored or overwritten | autoSize is true; set autoSize: false | ng-diagram-custom-nodes | |
| Typing in an input inside a node drags the node or pans | Add data-no-drag="true" / data-no-pan="true" | ng-diagram-custom-nodes | |
| Selection highlight invisible on a custom node | Host is display: inline | ng-diagram-custom-nodes, ng-diagram-styling | |
| No resize or rotate handles | Adornment missing, node not selected or rotated, or disabled | ng-diagram-resize-rotate-snap | |
| Snapping does nothing | The shouldSnap… callbacks return false by default | ng-diagram-resize-rotate-snap | |
| A node does not join a group on drop | Group lacks isGroup: true, or canGroup returned false | ng-diagram-groups |
Edges and linking
| Symptom | Likely cause | Skill | |
|---|---|---|---|
| Edge not drawn, no error | Wrong port id, port not measured, manual edge without points, or hidden | ng-diagram-edge-routing | |
[ngDiagram] Invalid edge coordinates detected for edge '<id>' | Missing node, free end without position, or invalid points | ng-diagram-edge-routing, ng-diagram-dangling-edges | |
[ngDiagram] Edge routing '<name>' is not registered… | Routing registered too late or misspelled | ng-diagram-edge-routing | |
| Edges hidden behind nodes | Default z-order; zIndex.edgesAboveConnectedNodes: true | ng-diagram-layering | |
| Drawn edges use the default template or routing | Set type / routing in finalEdgeDataBuilder | ng-diagram-linking | |
| Pressing a port starts no draw | Target-only or hidden port, or another draw or relink runs | ng-diagram-linking | |
| Edges created twice after enabling dangling edges | An edgeDrawEnded handler adds an edge on noTarget | ng-diagram-dangling-edges | |
| No relink handles on a selected edge, or a node covers them | Not relinkable, no routed path yet, or zIndex elevation turned off | ng-diagram-edge-relinking | |
event.source.id fails to compile after upgrading to 1.4.0 | EdgeDrawEndedEvent.source is optional | ng-diagram-linking |
Interaction and events
| Symptom | Likely cause | Skill | |
|---|---|---|---|
| No keyboard shortcut works | Focus is outside the diagram | ng-diagram-shortcuts | |
| All default shortcuts gone after customizing | shortcuts replaced as a plain array; use configureShortcuts() | ng-diagram-shortcuts | |
(output) handlers stopped firing | removeAllEventListeners() or events disabled | ng-diagram-events | |
[ngDiagram] Event listener error: Listener for "<event>"… | Your addEventListener callback threw | ng-diagram-events | |
selectionRemoved never fires for a delete button | It fires only for the Delete/Backspace key, deleteSelection() and cut() | ng-diagram-events | |
| Toolbar opens on mouse down or flickers | Use selectionGestureEnded, not selectionChanged | ng-diagram-events | |
| Browser menu appears over a custom context menu | preventDefault() ran after an await | ng-diagram-selection-clipboard | |
| Box selection does nothing on a tablet | Hold still for 400 ms, then drag | ng-diagram-touch | |
[ngDiagram] Invalid drop data… or a node created from a file drop | Something that is not a palette item was dropped | ng-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
- SKILL.md in the repositoryCheckingskills/ng-diagram-troubleshooting/SKILL.md
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
[](https://verified-skill.com/skills/synergycodes/ng-diagram/ng-diagram-troubleshooting)