How to import go-debug jointly with gojs-react?

I import go-debug in my file gojs.ts, which importing throughout project (I use DI).

import * as go from 'gojs/release/go-debug';

then I import in the same file

import { ReactDiagram } from 'gojs-react';

and then I get error in index file at render ReactDiagram

<>
  <ReactDiagram
    initDiagram={initDiagram}
    divClassName="diagram-component"
    nodeDataArray={[...examples, ...normalizeSchema]}
    onModelChange={handleModelChange}
    linkDataArray={linkDataArray}
    skipsDiagramUpdate
  />
</>

Error:

TS2769: No overload matches this call. 
Overload 1 of 2, '(props: DiagramProps | Readonly<DiagramProps>): ReactDiagram', gave the following error. 
Type '() => go.Diagram' is not assignable to type '() => import("C:/Users/user/Documents/projects/bot-ui/node_modules/gojs/release/go").Diagram'. 
Type 'go.Diagram' is not assignable to type 'import("C:/Users/user/Documents/projects/bot-ui/node_modules/gojs/release/go").Diagram'.
Property 'computeBounds' is protected but type 'Diagram' is not a class derived from 'Diagram'.
Overload 2 of 2, '(props: DiagramProps, context: any): ReactDiagram', gave the following error.
Type '() => go.Diagram' is not assignable to type '() => import("C:/Users/user/Documents/projects/bot-ui/node_modules/gojs/release/go").Diagram'. 

How to use go-debug jointly with gojs-react is absent in the tutorial. I don’t understand how to import right.

It might be easiest to leave the import statements as they were and instead temporarily swap out the go.js file with the go-debug.js file, wherever it is.

In other words, if you are using npm, rename node_modules/gojs/release/go.js to something safe and then copy node_modules/gojs/release/go-debug.js to node_modules/gojs/release/go.js.

Just remember to copy the original go.js file back when you are done debugging. Although if you forget, it shouldn’t break your app – but it will take more time and space.

Thanks for the tips here! I added a couple npm scripts to do this for me:

"gojs:debug:on": "npm run gojs:debug:off ; cp -R ./node_modules/gojs/release/* ./node_modules/gojs/release_bkup/ && mv ./node_modules/gojs/release/go-debug.mjs ./node_modules/gojs/release/go.mjs && mv ./node_modules/gojs/release/go-debug.js ./node_modules/gojs/release/go.js && mv ./node_modules/gojs/release/go-debug-module.js ./node_modules/gojs/release/go-module.js",
"gojs:debug:off": "mkdir -p ./node_modules/gojs/release_bkup/ ; find ./node_modules/gojs/release_bkup -maxdepth 1 -type f -exec mv '{}' ./node_modules/gojs/release/ \\;",