Our pure JavaScript Scheduler component

Post by fev.eva »

Dear Bryntum Support Team,

We have bought Schedulerpro a few months ago and now we are running into an issue we can’t solve ourselves.

We have an Angular Web-App and the Problem only appears if the code is build.
While developing everything is fine.
Furthermore, even in the build app the Problem appears on a fresh reload but by navigating between components in our app it suddenly starts to work.
We have debugged the issue and the error originates from this part in our code:

    new AssignmentModel({
        id: 'a' + eventsId,
        event: eventsId,
        resource: resourcesId,

We import the AssignmentModel like so: import { AssignmentModel } from ‘@bryntum/schedulerpro’

eventsId in this case is a number, but even so eventsId is defined the following error is thrown:
"ERROR TypeError: Cannot read properties of undefined (reading main....js 'dataSource')

This error is thrown because of the following code, that is part of the schedulerpro compiled code and probably part of the AssignmentModel constructor:

construct(e, ...i) {
                e = e || {};
                const {fieldMap: r} = this
                  , o = r.eventId.dataSource
                  , a = r.resourceId.dataSource
                  , s = r.event.dataSource
                  , l = r.resource.dataSource
                  , c = e[o]
                  , d = e[a]
                  , u = e[s]
                  , h = e[l];
                null != c ? e[s] = c : null != u && (e[o] = u.isModel ? u.id : u),
                null != d ? e[l] = d : null != h && (e[a] = h.isModel ? h.id : h),
                super.construct(e, ...i)

Here r is an empty object and because of that r.eventId.datasource can’t be accessed.
We are really confused here especially since the scheduler only appears to be broken under these specific circumstances.

You Help would be greatly appreciated.

Best Regards
Dominik Felden

Post by marcio »

Hey Dominik,

Welcome to our forums and thanks for reaching out!

Regarding the build problem, are you experiencing that on our demos or are you already using it in your application? Would it be possible to share a sample project for us to debug? You can get more info on that by checking our guidelines here https://www.bryntum.com/forum/viewtopic.php?f=1&t=772

Which Scheduler Pro version are you using in our application? Could you provide more context about how are you setting it up?

Best regards,

Post by mats »

@Dominik - Is this still a problem for you? Any chance you can provide us a simple test case so we can reproduce locally?

Post Reply