I'm trying to import a 3rd party javascript library from static resources in my lightning web component. I followed the exemple given in LWC documentation.
I encounter the folowing error :
Uncaught (in promise) TypeError: Cannot read property 'Symbol(ViewModel)' of undefined
Uncaught (in promise) TypeError: m is not a function
My sample code :
import loadScript from 'lightning/platformResourceLoader';
import fuse from '@salesforce/resourceUrl/fuse';
export default class SelectActivity extends LightningElement {
fuseLoaded = false;
renderedCallback() {
if(!this.fuseLoaded){
console.log(fuse);
loadScript(this,fuse + "/fuse.js")
.then( () => {
this.fuseLoaded = true;
})
.catch( error => console.log(error));
}
}
}
And my static resource is present :
Thank you in advance