Reference error after Updating to Angular 13 - dhtmlx is not defined


#1

I am using scheduler (dhtmlx-scheduler-commercial, version 4.4.9) in an Angular SPA. It was running fine in up to Angular 12.
Since I upgraded to Angular version 13.0.3 I get a Reference Error (dhtmlx is not defined).

Can anyone tell me why it is not working anymore and how to possibly fix it?

Complete error message:
ERROR Error: Uncaught (in promise): ReferenceError: dhtmlx is not defined
ReferenceError: dhtmlx is not defined
at Object.19732 (dhtmlxscheduler.js:12)
at webpack_require (bootstrap:19)
at Module.6186 (map-export-dialog.component.ts:16)
at webpack_require (bootstrap:19)
at Module.54122 (map.component.ts:55)
at Function.webpack_require (bootstrap:19)
at ZoneDelegate.invoke (zone.js:372)
at Object.onInvoke (core.mjs:25476)
at ZoneDelegate.invoke (zone.js:371)
at Zone.run (zone.js:134)
at resolvePromise (zone.js:1213)
at resolvePromise (zone.js:1167)
at zone.js:1279
at ZoneDelegate.invokeTask (zone.js:406)
at Object.onInvokeTask (core.mjs:25463)
at ZoneDelegate.invokeTask (zone.js:405)
at Zone.runTask (zone.js:178)
at drainMicroTaskQueue (zone.js:582)


#2

I managed to solve the problem by adding following line to scripts section in angular.json:

node_modules/dhtmlx-scheduler-commercial/codebase/dhtmlxscheduler.js

Just in case anyone has the same issue.