Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
GojsDiagramComponent
✓ import { GojsDiagramComponent } from 'gojs-angular';
✗ const GojsDiagramComponent = require('gojs-angular').GojsDiagramComponent;
ESM-only in Angular; CommonJS require is not standard for Angular libraries. TypeScript types are bundled.
GojsPaletteComponent
✓ import { GojsPaletteComponent } from 'gojs-angular';
Named export; use alongside GojsDiagramComponent for palette diagrams.
GojsOverviewComponent
✓ import { GojsOverviewComponent } from 'gojs-angular';
Named export; provides an overview of the main diagram.
DiagramModule
✓ import { DiagramModule } from 'gojs-angular';
✗ import { DiagramModule } from 'gojs-angular/src/diagram';
Correct import path is from the package root; subpath imports are not supported.
Shows minimal setup with GojsDiagramComponent in a standalone Angular component, including node and link data arrays and an initDiagram function.
import { Component } from '@angular/core';
import { DiagramModule, GojsDiagramComponent } from 'gojs-angular';
@Component({
selector: 'app-root',
standalone: true,
imports: [DiagramModule],
template: `
<gojs-diagram
[initDiagram]="initDiagram"
[nodeDataArray]="nodeData"
[linkDataArray]="linkData"
[modelData]="modelData"
></gojs-diagram>
`
})
export class AppComponent {
nodeData = [
{ key: 1, text: 'A' },
{ key: 2, text: 'B' }
];
linkData = [
{ from: 1, to: 2 }
];
modelData = { class: 'go.GraphLinksModel' };
initDiagram() {
const $$ = (window as any).go.GraphObject.make;
return $$((window as any).go.Diagram, 'diagramDiv', {
'undoManager.isEnabled': true
});
}
}
Errors
Common errors & fixes
ERROR NullInjectorError: No provider for GojsDiagramComponent!
GojsDiagramComponent not imported in standalone component or NgModule.
fixAdd GojsDiagramComponent (or DiagramModule) to imports array of the component or NgModule.
TypeError: Cannot read properties of undefined (reading 'make')
GoJS library not properly loaded or 'go' global not available in initDiagram.
fixInstall gojs (npm install gojs) and ensure it's available: import * as go from 'gojs'; then use go.GraphObject.make.
Error: immer version mismatch: expected 11.x, got 10.x
Incorrect immer version installed; peer dependency requires ^11.1.3.
fixRun npm install immer@^11.1.3 --save
Error: (SystemJS) Unexpected value 'DiagramModule' imported by module 'AppModule'
DiagramModule incorrectly imported in an Angular NgModule that doesn't support the module system.
fixRemove DiagramModule import if using standalone components; otherwise, verify NgModule imports syntax.
Audit
Dependencies
@angular/commonrequiredProvides Angular common directives and pipes; peer dependency for Angular 20 compatibility.
@angular/corerequiredNeeded for Angular component and service infrastructure; peer dependency for Angular 20 compatibility.
gojsrequiredCore GoJS library for diagramming functionality; peer dependency version 3.x.
immerrequiredUsed for immutable state management within the Angular wrapper; peer dependency version ^11.1.3.