DHTMLX Gantt + Export in Angular 12

We are using DHTMLX Gantt 7.1.6 in an Angular 12.1.1 project.
We followed this example:


Unfortunately, we are getting this error:

Error: Module not found: Error: Can't resolve 'http'.

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }

How can we successfully include and use the export module in projects with Angular 12?

Hello Silvia,
It seems that the issue with the export’s api.js file occurs because of the functionality that was added to support Node.js import and export. Although, that code is not used in the browser, Angular checks it and tries to execute it.
In the future, you won’t need to include that file to enable the import and export functionality. For now, you can use the modified file:

Here is the demo for Angular 12:

1 Like