my problem is the following: I'm trying to run a JS function with a HTML button, but this error appears each time I click the button:
Uncaught (in promise) ReferenceError: require is not defined
Im pretty sure that it is because I'm using Puppeteer in my JS file, and the function which the button executes uses it.
const puppeteer = require('puppeteer');
I have the import on the top of the file, but I think HTML only executes the function and doesn't read the import.
So the thing here is, can I dynamically import the module inside my function?
Thanks in advance!