Yes it’s only recently that we tightened up the warning.
I think that one file can reference Go one way and other code references it another way, where even if it is the same file, module resolution is not clever enough to know this and loads them twice. However it is happening, it can be bad because if Go gets loaded twice, some initialization state can happen twice, or two clipboards could exist internally where half the code uses one clipboard and the other half the code uses the other clipboard, so its worth figuring out why.
I am supposing that there are not 2 instances of go.js
(or even 2 instances of node_modules/gojs/release/
) in the project, though maybe Jest is making copies or something behind the scenes. If not, then maybe try having the import statements reference the file exactly (node_modules/gojs/release/go.js) and see if that fixes it.
Alternatively, you could have 1 file import GoJS, and maybe export the go
symbol, and then have the 2nd file import go
from that first file.
Sorry that I don’t have a very precise answer, just some guesses. Let us know what you find.