Closed shollander closed 5 months ago
Possibly this is fixed in 2.3.16. Can you give it a try?
I still get esbuild warnings when using 2.3.16. The error is slightly different, but the idea is the same:
The CommonJS "module" variable is treated as a global variable in an ECMAScript module and may not work as expected [commonjs-variable-in-esm]
node_modules/gojs/release/go-module.mjs:41685:74
41685 | 'undefined' !== typeof module && 'object' === typeof module.exports && (module.exports = 'undefined' !== typeof global ? global.go : self.go);
| ~~~~~~
I should mention that in order to see these warnings you need to run the build with the verbose flag (i.e. ng build --verbose
).
We've changed this in the 3.0 (currently beta) branch, by removing any module.exports = ...
from ESM files. We might change it for 2.3 also, but maybe not. It's difficult to make changes like this that may break some customer builds, however unlikely, so its a bit preferable to do it in a version bump.
3.0 will become the latest version soon.
If you want to try the 3.0 beta, 3.0.0-b7 has been released with this change.
npm i gojs@beta
When using GoJS in an Angular 17 project that uses esbuild (now the default compiler for Angular), the following warnings are generated because of GoJS:
Note: We are currently using version 2.2.22 of GoJS, but this issue still appears in the latest version (2.3.14).