I am building a chrome browser extension, and I am trying to use the library PapaParse to parse through a csv file. I am working with a local copy of the library, which I downloaded from their website. I am trying to import the library into a JavaScript file (I am not working with it in an html file), but it is giving me a lot of trouble. I am new to working with libraries, but I feel like it shouldn't be this complicated. I am trying to import it into my content script, but I can also create a separate .js file to work with it if need be. I have tried many different ways to solve this problem, and it has been recommended to me to import it as a module using the import statement. When I try
import * as myModule from './PapaParse/papaparse';
I get the error "Uncaught SyntaxError: Cannot use import statement outside a module". Now, normally it looks like this error is usually solved by adding type="module" to the script tag in the html file. However, I am not working with it in an html file, I would just like to use it in a JavaScript file. Since it is a chrome extension, the JavaScript logic needs to be separate from the HTML code anyways.
For some more background info: I am working in NetBeans, and I have downloaded the entire PapaParse folder into my site root (public_html) folder. I am new to working with libraries, so it's possible I am missing something simple!