Uncaught TypeError: Cannot read property ‘setImmediate’ of undefined at suite.min.js:12


#1

Hi,
I use dhx-suite npm module in my vue-electron project.
The version of dhx-suite is 7.3.2 and when I execute the application I get this error message below.
How can I fix this? I have no idea.

Uncaught TypeError: Cannot read property ‘setImmediate’ of undefined
at suite.min.js:12
at Object. (suite.min.js:12)
at Object.o.m.i (suite.min.js:12)
at o (suite.min.js:21)
at Object.o.m.i (suite.min.js:12)
at o (suite.min.js:21)
at Object.o.m.i (suite.min.js:12)
at o (suite.min.js:21)
at Object.o.m.i (suite.min.js:12)
at o (suite.min.js:21)


#2

Could you please, provide a complete demo of your app, where the poorblem can be reconstructed locally.


#3

What do you mean demo? I cannot share my project because of my company’s security policy.
All I can give you is just the version of dhx-suite (7.3.2)

I found several questions which are same as mine, but I couldn’t get the proper solution.

import { ContextMenu } from “dhx-suite”;

I import the module like this. Is there any issue??


#4

I just found one of your answers,

“As a workaround please try to include the dhx.Suite sources globally in the package.json in the “scripts” section instead of importing the sources to the specific view.”

Could you give me the way to do this? I dnt get it


#5

Include the sources (js and css) of the dhx.Suite in the index.html of your app.
Like:

	<script src="assets/dhtmlx/suite.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="assets/dhtmlx/suite.css" type="text/css" charset="utf-8">

#6

I did but nothing changed. Same error happened…


#7

Hi @pomme426,

Don’t import components in the usual form:

import { ContextMenu } from “dhx-suite”; 

Instead use the global dhx variable:

const contextMenu = new dhx.ContextMenu()

I guess that ES6 module style is not very well supported. So I conclude that the npm package is not very useful :sweat:


#8

I nailed it!!! Thank you so much!!! :smile::clap: