Angular > TypeError: Cannot read properties of undefined (reading ‘setImmediate’)

I am getting the following error when importing the following line in a component which is a part of a module

import { Grid as GridDHX} from ‘src/assets/Libs/jsLibs/dhtmlx-suite-7/suite’;

ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading ‘setImmediate’)
TypeError: Cannot read properties of undefined (reading ‘setImmediate’)

any solution?

Please, try to import the dhx sources globally in the app, instead of importing them to a specific view. It should solve the problem.
If the problem still occurs for you could you please, provide a complete demo, where the problem could be tested.

Hi, I ran into the exact same error when importing the suite layout component (7.2.5) into an Angular 9 project. I solved it by declaring the dhx namespace in the view component:
import { Layout } from 'dhtmlx-suite/codebase/types/ts-layout';
declare const dhx: any
const layout: Layout = new dhx.Layout(<parent>,<config>)
In addition I added the suite.js into the scripts section in angular.json.
Hope this helps.

1 Like