Our pure JavaScript Scheduler component


Post by assurancedigital »

Hi Ghulam,

Thanks for the call yesterday, really appreciated.

When I was running the solution on debug mode (even in the yesterday's screen share session), package is working fine. However, when I deploy the solution and added the webpart into the page, we are facing an error.

Scheduler component is not loading. (Screen shot added below).

"Uncaught (in promise) TypeError: e.forEachAvailabilityInterval is not a function"

By the way, this function has been called in one of the internal js file (in my example - bryntum-scheduler-pro-web-part_9956863ffcd8ff539ebb.js).

From dev side, I am not able to get this file to comment or modify this line of code. Please help us on this.

Attaching the reference screen shots.

Screen shot #1

BryntumError2.png
BryntumError2.png (56.02 KiB) Viewed 186 times

Screen shot #2

BryntumError3.png
BryntumError3.png (147.06 KiB) Viewed 186 times

Screen shot #3

BryntumError4.png
BryntumError4.png (178.81 KiB) Viewed 186 times

Post by assurancedigital »

Screen shot #4

BryntumError5.png
BryntumError5.png (121.26 KiB) Viewed 186 times

Post by ghulam.ghous »

I am able to reproduce this issue, and looking into the possible causes of this, I'll update you once I have found the reason.


Post by ghulam.ghous »

Please use the following GulpFile.js:

// gulpfile.js
const build = require('@microsoft/sp-build-web');
const path = require('path');

build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);

// Fix 'serve' bug on SPFx 1.18 and later
var getTasks = build.rig.getTasks;
build.rig.getTasks = function() {
    var result = getTasks.call(build.rig);
    result.set('serve', result.get('serve-deprecated'));
    return result;
};

build.configureWebpack.mergeConfig({
    additionalConfiguration : (generatedConfiguration) => {
        // Add Babel loader rule for Bryntum’s code to transpile
        generatedConfiguration.module.rules.push({
            test    : /\.js$/,
            // Only transpile the relevant Bryntum locale files
            include : /node_modules[\\/]+@bryntum[\\/]+\w+-thin[\\/]+lib/,
            use     : {
                loader  : 'babel-loader',
                options : {
                    presets : [
                        [
                            '@babel/preset-env',
                            {
                                targets     : {
                                    chrome : '71',
                                },
                            }
                        ]
                    ]
                }
            }
        });

        // Ensure Bryntum paths are resolved properly (for CSS references, etc.)
        generatedConfiguration.resolve.alias = {
            ...generatedConfiguration.resolve.alias,
            './@bryntum' : path.resolve(__dirname, './node_modules/@bryntum')
        };

        return generatedConfiguration;
    }
});

build.initialize(require('gulp'));

It was again a transpilation issue as Generators being used in our Engine were not correctly transpiled. Please try above and let me know if you face any issues.


Post by assurancedigital »

Hi Ghulam,

Thanks for the response. It's working fine now.

Appreciated your help!

Thanks,
Giri


Post by ghulam.ghous »

Hey Giri,

Thanks for letting me know. I am glad that all is working fine now and I would like to thank you guys for your patience. Please don't hesitate to reach out if you have any further questions, or face any issues. We will be happy to help you out.

Regards,
Ghous


Post Reply