liveUpdate error

Contente, now that we’ve heard from Aliaksandr, see the attached files. Just a caution, it has been four years and I remember doing the thing, but certainly have vague memory of details, except that the code was basically good except missing some typeof statements in a number of instances. Looking in my files from that timeframe, these files should be the ones that worked at that time, in that application. --Eddhtmlxscheduler.js.zip (46.9 KB)
dhtmlxscheduler_limit.js.zip (5.2 KB)

@Aliaksandr I’ve been working through your instructions and after a few issues I have the live-update/server.js running on localhost/8008.

My Scheduler backend server is running and when I browse to my Scheduler I see the following errors:

image
image

image
image

Do you have any idea what’s going on please?

Thank you.

I added

type=“module”

to my script inclusion <script type="module" src="./live-update/server.js"></script>

This has swapped one of the errors:

image

// connect backend to scheduler
var dp = scheduler.createDataProcessor({
    url: `${server}/event`,
    mode: "REST"
});

dp.live_updates("/live-update");

Any help would be greatly appreciated.

Thank you.

Hello @squatman,

The require is not defined issue on the screenshot says, that you are unable to import the required node module, it could happen by a few reasons that are likely connected with your project config, you can find them by the following link:

Likely, your case is the second point of the list, so you can use the above’s article in order to fix the issue.

Kind regards,

@Siarhei thank you for getting back to me.

Unfortunately my code already represented both of the solutions.

Can we address why

dp.live_updates is not a function

image

// load data from backend
scheduler.load(`${server}/data`, "json");

// connect backend to scheduler
var dp = scheduler.createDataProcessor({

url: `${server}/event`,
mode: "REST"
});

dp.live_updates("/live-update");

Thank you.

Hello @squatman,

I just tested the demo from the above, and looks like it doesn’t work with new scheduler versions.

Here is the latest live-update demo:
https://files.dhtmlx.com/30d/025c0a3b38ae26c15801472e13a1c370/scheduler-howto-node+live.zip
How to run:

Open the terminal and start node.js server:

npm install
npm start

then split the terminal and run the Faye app:

cd live-update
npm install
npm start

It should work correctly with no issues.

Kind regards,

1 Like

@Siarhei it works!! Thank you very much!