This code looks fine for either GoJS v2 or GoJS v3. I bet you have some configuration problem in your project. Could you please tell us exactly which GoJS-related files you are loading and how they are being chosen and loaded?
Please check that you are not loading the GoJS library twice.
Also, have you reviewed the list of incompatibilities in the Change Log? Change Log | GoJS
What build and package system are you using – is it using ES modules?
If so, you need to use the extension files that are in the extensionsJSM/ folder.
Also, what do you mean by:
I replaced . . . undefined/null values for fill property, undefined margin values and so on.
You probably didn’t need to do that unless it was wrong before.
The package.json just controls which GoJS library file to use.
It doesn’t control which extension your project uses. We recommend that you copy the extension file into your project, although that is not needed if just loading an unmodified extension at extensions/ using a simple (non-module) <script> tag.
OK, so there are additional configuration problems. Could you show us which GoJS-related files are loaded, in the debugger? Also, are there are any warning or error messages in the console?
[EDIT] No, you should make sure that all of your modules import exactly the same specifier for each module. In the case of GoJS, I suggest you use “gojs”. That is what each of the extensions do.
OK, this at least confirms that you are using ES modules (for GoJS, at least), and thus that you need to use the extensionsJSM/ files rather than those from extensions/.
It also confirms that your system isn’t choosing the “development” build but the “production” build. (That doesn’t matter for extensions.)
Those binding errors are real problems, because you are trying to bind non-existent target properties on the Shape and TextBlock classes.
However those binding errors aren’t the cause of the basic problems that you have. I’m sorry, but I still do not have enough information to figure out what’s going on.
you need to use the extensionsJSM/ files rather than those from extensions/.
what is the difference? I tried all these imports, nothing works:
import Go from 'gojs'
import Go from 'gojs/release/go-module'
import Go from 'gojs/release/go.mjs'
However those binding errors aren’t the cause of the basic problems that you have. I’m sorry, but I still do not have enough information to figure out what’s going on.
Did you make sure that all of your files did exactly the same import?
The JS files in extensions/ can only be loaded via a plain <script> tag.
The JS files in extensionsJSM/ can only be loaded as ES modules.
If your build system is trying to use UMD/CommonJS modules, that would definitely cause your project to break. You should check that. But that’s probably not the cause.
If you want, you can ignore these problems by commenting out the use of that extension tool, so that we can address the other problems that you have posted about.
Is the user able to do any interaction using the mouse, at all? If so, can you characterize the nature of the things the user can no longer do? Do keyboard events still work, or is there a problem with focus?
OK, so the only input event problem is handling mouse clicks.
Have you tried updating to GoJS 3.0.2?
Do you get the same behavior when using different browsers on the same machine? Or on different kinds of platforms, especially with touch/finger or stylus events?
Do you get the same behavior when using different browsers on the same machine? Or on different kinds of platforms, especially with touch/finger or stylus events?
The same beahvior on Chrome 124 & Mozilla 125 desktop. Did not test on mobile devices.