I have loaded my static resource and I wrote the following code to load the javascript.
when I load my component in salesforce I get the following error Uncaught (in promise) TypeError: Cannot read property 'body' of undefined
at eval (lwcStaticResource.js:4)
import { LightningElement } from 'lwc';
import { loadScript, loadStyle } from 'lightning/platformResourceLoader';
import Scheduler from '@salesforce/resourceUrl/Scheduler';
export default class LwcStaticResource extends LightningElement {
renderedCallback() {
Promise.all([
loadScript(this, Scheduler + '/scheduler.umd.js'),
loadStyle(this, Scheduler + '/scheduler.default.css'),
])
.then(() => {
alert('Files loaded.');
})
.catch(error => {
alert(error.body.message);
});
}
}