LearnNewsExamplesServices
Frontmatter
id6597
titleCalendar - Basic - Windows Browsers (all of them) - Maximum Call Stack Size Exceeded error
stateClosed
labels
bughelp wantedno auto close
assignees[]
createdAtMar 30, 2025, 8:11 PM
updatedAtApr 6, 2025, 11:30 PM
githubUrlhttps://github.com/neomjs/neo/issues/6597
authorcgauthier
commentsCount4
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 6, 2025, 11:30 PM

Calendar - Basic - Windows Browsers (all of them) - Maximum Call Stack Size Exceeded error

Closed v8.41.0 bughelp wantedno auto close
cgauthier
cgauthier commented on Mar 30, 2025, 8:11 PM

When trying to load the Calendar demo (basic) in any windows browser, we get a maximum call stack size exceeded error which blocks the UI from rendering the component.

We suspect this code to to be the problem.

    getHierarchyData(data=this.getPlainData()) {
        let me     = this,
            parent = me.getParent();
            console.log("getHierarchyData - parent:");
            console.log(parent);
        if (parent) {
            return {
                ...parent.getHierarchyData(data),
                ...me.getPlainData()
            }
        }

        return me.getPlainData()
    }

Image

cgauthier added the bug label on Mar 30, 2025, 8:11 PM
tobiu cross-referenced by #6598 on Mar 30, 2025, 8:46 PM
tobiu added the help wanted label on Mar 30, 2025, 8:48 PM
tobiu added the no auto close label on Mar 30, 2025, 8:48 PM
tobiu
tobiu Mar 30, 2025, 8:56 PM

@cgauthier thanks for opening the ticket! sadly, I can not reproduce it on Mac OS (it works locally as well as inside the deployed version: https://neomjs.com/examples/calendar/basic/index.html )

    count = 1

/**
 * Returns the merged data
 * @param {Object} data=this.getPlainData()
 * @returns {Object} data
 */
getHierarchyData(data=this.getPlainData()) {
    let me     = this,
        parent = me.getParent();

    console.log(me.id, parent, me.count);
    me.count++;

    if (parent) {
        return {
            ...parent.getHierarchyData(data),
            ...me.getPlainData()
        }
    }

    return me.getPlainData()
}

Image

If I recall it correctly, you got more method calls than I do => for me it is 22x of getHierarchyData().

Since parent is always null, it leaves us with 2 options where the issue most likely happens.

  1. Inside getPlainData()
  2. onDataPropertyChange() gets called more often on windows

I added the "help wanted" label to this ticket, since I don't have windows installed here => I can not verify that a hotfix candidate actually resolves it.

tobiu
tobiu Mar 30, 2025, 9:03 PM
    getPlainData(data=this.data) {
        let plainData = {};

    console.log(Object.entries(data).length);

    Object.entries(data).forEach(([key, value]) => {
        if (Neo.typeOf(value) === 'Object') {
            plainData[key] = this.getPlainData(value)
        } else {
            plainData[key] = value
        }
    });

    return plainData
}

This logs 22x:

Image

which looks fine: https://github.com/neomjs/neo/blob/dev/src/calendar/view/MainContainerStateProvider.mjs

12 top level properties inside data, 4 properties inside data.events, 2 properties inside data.timeFormat.

tobiu
tobiu Mar 30, 2025, 9:08 PM
    onDataPropertyChange(key, value, oldValue) {
        let me      = this,
            binding = me.bindings && Neo.ns(key, false, me.bindings),
            component, config, hierarchyData, stateProvider;
console.log(key, value);
        // ...
    }
Image

this part also looks fine on Mac OS. onDataPropertyChange() only gets called once for each data property.

tobiu referenced in commit 34d6eb0 - "Calendar - Basic - Windows Browsers (all of them) - Maximum Call Stack Size Exceeded error #6597" on Apr 6, 2025, 11:27 PM
tobiu referenced in commit 8d418bc - "#6597 cleanup" on Apr 6, 2025, 11:28 PM
tobiu
tobiu Apr 6, 2025, 11:30 PM

as it turned out, this was not a windows issue, but UTC vs later starting timezones (e.g. USA). thanks a lot @cgauthier for the debugging session!

while it is working now, it needs follow up tickets.

tobiu closed this issue on Apr 6, 2025, 11:30 PM