I have a JS library that provides a module. I am importing it in my LWC like this example here: https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.create_third_party_library
Sadly, there is no example on how to import d3
(if you look carefully you can see SF only import D3 in caps to reference resource, not the lib, and just rely on d3
being global).
I tried importing from 'libname'
but i get the error that this is not a known LWC module.
If i try to import from resource/libname, i get the below.
Invalid reference Resource/somelib.min.js of type resourceUrl in file myComponent.js
(Example module to try: https://github.com/flatpickr/flatpickr)
Without it everything works save for Intellisense in VS code and pesky warnings about functions being undefined.
EDIT the code works fine. I am asking how to get symbols into my code.
d3
is being utilized or you are trying to import another 3rd party JS and would like to understand how to do that?import x from ‘myscript’;
in lwc to avoid ‘undefined’ red squigglies in vs code.