Module not found: Error: Can't resolve 'lightning/platformResourceLoader'

I have created a LWC (Lightening Web Component)by referring below documentation.

https://trailhead.salesforce.com/en/content/learn/projects/build-your-first-app-with-lightning-web-components-open-source/create-the-application

And, I expect to use jQuery by referring the below link

https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.js_third_party_library

But, getting module not found issue as follows,

Module not found: Error: Can't resolve 'lightning/platformResourceLoader'

Please can any one help me on this.


Solution 1:

You are developing an app with lwc oss framework that lives outside the Salesforce platform, and you are trying to use the module 'lightning/platformResourceLoader' that is a module only available on Salesforce platform. If you want to use JQuery in lwc oss, you need to install JQuery as npm package, or import as cdn