I am trying to import a 3rd party javascript library into my LWC and everytime I try to push the code to my Scratch Org, I get the below error.
LWC1513: @salesforce/resourceUrl modules only support default imports.
The library consists to 2 files:
- A javascript file
- A CSS file
I have zipped these 2 files into one and uploaded them as a static resource. I use the below code in the js file of my LWC:
import { Library } from '@salesforce/resourceUrl/CustomLibrary';
The static resource has the name 'CustomLibrary' in my org. The push succeeds without this line of code though. I spent enough time to figure out what is going wrong but with little success.
I came across a similar link on Stack Overflow, but that didn't help me either.