Extending FlexGrid class creates error after update to version 5.20231.904

Posted by: thomas.froescher on 18 October 2023, 3:47 am EST

    • Post Options:
    • Link

    Posted 18 October 2023, 3:47 am EST

    Hi,

    after updating version from 5.20231.888 to 5.20231.904 I get an error when creating my custom class which extends FlexGrid.

    Running this sample

    import {FlexGrid} from "@grapecity/wijmo.grid";
    
    document.readyState === 'complete' ? init() : window.addEventListener('load', init);
    export class MyCustomFlexGridSample extends FlexGrid {
        constructor(mySelector) {
            super(mySelector);
        }
    }
    
    function init() {
        const myCssSelector = document.createElement('div')
        const myFlexGrid = new MyCustomFlexGridSample(myCssSelector)
    }

    I get this error

    es2015-esm.js:14 Uncaught ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor
        at new ArrayBase (es2015-esm.js:14:56187)
        at new ObservableArray (es2015-esm.js:14:56637)
        at new RowColCollection (es2015-esm.js:14:45427)
        at new RowCollection (es2015-esm.js:14:49965)
        at es2015-esm.js:14:66455
        at MyCustomFlexGridSample.deferUpdate (es2015-esm.js:14:84526)
        at new FlexGrid (es2015-esm.js:14:66393)
        at new MyCustomFlexGridSample (flexGridExtend.js:6:9)
        at init (flexGridExtend.js:12:24)

    Any ideas what’s going wrong here?

    Thanks

  • Posted 18 October 2023, 11:56 pm EST

    Hi,

    We are not able to replicate the issue on our end. Could you please share a sample replicating the issue? You could also modify the below-shared sample such that it replicates the issue that you are facing on your end.

    Please refer to this sample for reference: https://jscodemine.grapecity.com/share/g0XaXObwVk62B7JvUChP6A

    Regards

    Anirudh

  • Posted 19 October 2023, 7:59 am EST

    Hi,

    thanks for the sample. I am using Javascript Modules (esm2015) directory in the brower (loaded as module).

    I couldn’t reproduce the error with jscodemine, but I have attached a simple example similar to your sample that shows a flex grid with minor version 888, but throws an error with 900 and 904.

    I am using rollup.js to create esm code.

    Flexgrid-rollup-esm-error.zip

    Regards,

    Thomas

  • Posted 20 October 2023, 2:56 am EST

    Hi Thomas,

    Thank you for sharing the sample. I am able to replicate the issue on my end and have forwarded the issue to DEV team. I will let you know as soon as I get any updates from the concerned team.

    Thank you for your understanding.

    Regards

    Anirudh

  • Posted 9 November 2023, 2:15 am EST

    Hi Anirudh,

    any updates on this topic?

    Thank you

    Thomas

  • Posted 10 November 2023, 7:46 am EST

    Hi Thomas,

    The issue is still with the DEV team and they are investigating the issue. I will let you know as soon as I get any updates from the DEV team. Please note the internal tracking ID of the issue for further communication: WJM-31257.

    Thank you for your patience and understanding.

    Regards

    Anirudh

  • Posted 1 February 2024, 9:51 am EST

    Hi Anirudh,

    are there any news on that? Tried lastest nightly version, but still doesn’t work.

    Thanks

    Thomas

  • Posted 2 February 2024, 9:24 am EST

    Hi Thomas,

    This issue is still with the DEV team. I have asked about the updates on this issue from the DEV team. I will provide you the updates as soon as I get any information from the DEV team.

    Thank you for your patience and understanding.

    Regards

    Anirudh

  • Posted 22 February 2024, 2:41 am EST

    We’ve recently attempted to configure our Angular build via a custom webpack configuration as per https://developer.mescius.com/wijmo/docs/GettingStarted/NPM-Module-Formats so that we leverage the ES2015 variant of Wijmo.

    We encountered the same issue in the same place (on 5.20232.939):

    object ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor
        at new ArrayBase (es2015-esm.js:14:56318)
        at new ObservableArray (es2015-esm.js:14:56768)
        at new RowColCollection (es2015-esm.js:14:45974)
        at new RowCollection (es2015-esm.js:14:50540)
        at es2015-esm.js:14:67158
       ...
  • Posted 23 February 2024, 4:45 am EST

    Hi Mark,

    To investigate the issue related to the usage of ES2015 + ESM (es2015-esm.js) wijmo files in Angular build, please provide a small offline sample sharing the custom webpack configuration in the sample along with its usage.

    Also, please share the steps that are needed from my end to replicate the issue.

    Please modify this simple FlexGrid sample such that it uses your custom webpack configuration: Sample.zip

    Thank you.

    Regards

    Anirudh

  • Posted 22 April 2025, 6:42 pm EST

    I’m upgrading from a 2019 version to 5.20232.939, and am also running into this ReferenceError.

    Was there ever a fix/resolution for this?

  • Posted 23 April 2025, 7:21 am EST

    Hi Paul,

    The original issue mentioned in this thread can be resolved by using the following config in rollup.config.json’ file -

    // rollup.config.js 
    
    // In the .888 version 
    nodeResolve({
        mainFields: ['esm2015'],
        browser: true,
    }),
    
    // In the .900 version 
    nodeResolve({
        browser: true,
    }),

    You can try this solution if it works in your case. However, if you still face this issue, please share a small sample in which we can replicate the issue, so that we can investigate it on our end and assist you accordingly.

    Regards

  • Posted 25 April 2025, 12:58 pm EST

    didn’t seem to work for me, but eventually got it working.

    was trying to store local copies of wijmo, which i couldn’t resolve the ‘super constructor ReferenceError’ with wijmo classes.

    decided to give up on local copies, and grab from npm @grapecity, which is now working

    Note: i also encountered errors with npm @mescius for my specific version, so i went back to @grapecity

  • Posted 28 April 2025, 2:06 am EST

    Hi Paul,

    Thank you for the update. The older Wijmo versions are not available under @mescius npm packages, your Wijmo version must be lower than 5.20232.939, due to which you need the @grapecity npm packages. However, we are glad that the issue is resolved now.

    Regards

  • Posted 30 April 2025, 11:48 am EST

    No, the 5.20232.939 wouldn’t work with @mescius (checked version in node_modules files).

    Looking closer, I was getting a bunch of typing errors with wijmo classes, because the @mescius typing files had references to @grapecity.

    Switched it over to @grapecity which works fine out of the box.

  • Posted 1 May 2025, 1:09 am EST

    Hi Paul,

    There should not be any with @mescius packages with Wijmo version 5.20232.939, as it works as expected on our end. You can verify it in the attached sample. However, your issue seems to be resolved by using the ‘@grapecity’ packages. If you still want us to investigate the issue further, please share a small sample in which the issue can be replicated, so that we can investigate it on our end.

    You can also modify the attached sample to replicate the issue and share it with us.

    Regards

    sample_939.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels