I am new to javascript and electron. I created a small project which is about recording multiple puppeteer tabs at the same time so I used this package called puppeteer-tab-recorder. I want to use this package to record some tabs with video and audio but there is something wrong with the way to import this package. This is how I imported it:
const {
recommandChromeArgs,
createTabRecorder,
} = require("puppeteer-tab-recorder");
but it throws this error:
VM157 renderer_init:2 Error: require() of ES Module D:\...\node_modules\puppeteer-tab-recorder\dist\index.js from D:\...\scripts\preload.js not supported.
Instead change the require of index.js in D:\...\scripts\preload.js to a dynamic import() which is available in all CommonJS modules.
I tried asking AI for help but I didn't understand anything so if someone can tell me what am I doing wrong I would appreciate it.