Error while loading a js as static resource in lightning Web component

I have a static resource name KendoUI, which is a javascript and is public. In my application, I have this :

import { LightningElement } from 'lwc';
import { loadScript, loadStyle } from 'lightning/platformResourceLoader';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import kendoUI from '@salesforce/resourceUrl/KendoUI';

export default class Lwcsheetkendoui extends LightningElement {
    kendoUIInitialized = false;

    renderedCallback() {
        if(this.kendoUIInitialized) return;
        this.kendoUIInitialized = true;
        loadScript(this, kendoUI + '/Kendo/kendo.all.min.js')
                        .then(() => { /* callback */ alert('Success'); })
                        .catch(error => {alert(error);});

JS file has been not loaded and error is throwing undefined in the alert.
I tried other simple JS files and those are working fine. but I have to user KenoUI js only.

Does anyone has experienced the same issue?


Source : Link , Question Author : Pankaj , Answer Author : Community

Leave a Comment