Module not found for extensions after 3.X upgrade

Hi

after upgrading from 2.X to 3.X, we downloaded the new extensions, put them in the same location they where (extensionJSM and extensionTS folders).
but now during build we get the error :
“Module not found: Error: package path … is not exported from package”

any ideas why?

Are you using JavaScript/EcmaScript modules? Those are in the extensionsJSM folder. In version 3.0 we deleted the extensionsTS folder, which held UMD-style modules.

I inheritated PortShiftingTool and implement my HoshenPortShiftinhTool.
How can implement my tool if PortShiftingTool is not supported anymore ?

It is still supported, but the kit now includes just two module compilation targets (for script tags and for ES module imports) instead of three (no longer for require). If you want it for require, compile the TS file to a UMD module. Here is the (original v2.3) tsconfig.json:

{
  "compilerOptions": {
    "module": "umd",
    "target": "es5",
    "strict": true,
    "noImplicitOverride": true,
    "noUnusedLocals": true
  }
}

Of course you might want to update the language “target” to be whatever your project is using.

I don’t quite understand:
we are using it in Angular - that is only in ts files, and we use import not require.
in our tsconfig compiler options we are using
“target”: “ES2022”
strict: true
module: ES2022

I’ve put all the plugins in ExtensionsJSM just in case and call them from there

changing the directory did not help with the error

If you have copied the .ts file(s) that you are using into your project, then you are treating it like your own code. This is what we have always recommended. Don’t refer to it in our extensions… directory.

OK,
Compilation passed but i get the following error :

That’s very odd. That method is clearly defined: GraphLinksModel | GoJS API and present in the latest go-debug.js and go.js files. As is the internal interface method isGroupForData. I cannot explain how in your situation the value of this model (i.e. the Diagram.model’s value of this) could be wrong.

is it a gojs 3.0 new function ?

GraphLinksModel.isGroupForNodeData is an original method – it has been present since before 1.0.

I think the IGroupModel internal interface (including its isGroupForData method) was new in 2.0.

Up until now, we were using GOJS 2.3 for 3-4 years.
I tried to run a second application in our project that is using GOJS and it crashed for the same reason.
At least i was able to track the crash point in our code :

What is this in that initialization code?

Do you call Model.toJson and Model.fromJson, or other related methods involved with the serialization of models? If your code doesn’t, how is serialization implemented, and can you test that on its own?

Why do you have references to Diagram or GraphObject related objects in your model data? I’m referring to the values of mouseDragEnter and mouseDragLeave, which I would guess are closures. In fact having functions as values in data objects is problematic by itself.

What is the Diagram.model set to?