I'm a little bit stuck building my first Chrome Extension. After working trough the basic concepts, I'm now trying to get an external library running. Furthermore it's a npm library and I'm aware that a Chrome Extension is not running node.js!
So I just learned about module bundlers and that I could try using a minimized .js file to import it in my popup.js.
The module I'm trying to import is the following:
https://www.npmjs.com/package/sbd?activeTab=code
And they already provide a minimized version under the path: /sbd/dist/sbd.min.js
(it might get more complicated trying to import any other npm library that does not support this file already)
So far so good.
Now... I changed my manifest.json:
Imported the library and tried to use a function:
+
At this point it looked promising. Visual Studio Code already recognising the imported, available functions. However... when I try to run them I get the following error:
And I don't get why. Am I still missing something about the concept of "How to import external libraries to a Chrome Extension"? The error makes no sense to me.
What might cause the error? Is there an easier way to get this running?
Thanks in advance.
Cheers, Dennis