Hello I'm trying to make an electron desktop app to run an automation code that use puppeteer to scrape some sites
this is my code background.js
const browser = await puppeteer.launch({
executablePath:'google-chrome',
headless: false,
defaultViewport: null,
args: ['--no-sandbox', '--start-maximized' ],
slowMo:25,
})
const page = await browser.newPage();
await page.goto("https://m.facebook.com")
await app(page)
but when I start to test my script using npm run dev I face the problem that says
A JavaScript error occurred in the main process
Uncaught Exception:
SyntaxError: Invalid regular expression: /\[\s*(?<attribute>\w+)\s*=\s*(?<quote>"|')(?<value>\\.|.*?(?=\k<quote>))\k<quote>\s*\]/: Invalid group
at Object.<anonymous> (/home/yghonem/Desktop/Facebook/activate/node_modules/puppeteer/lib/cjs/puppeteer/common/AriaQueryHandler.js:30:25)
at Object.<anonymous> (/home/yghonem/Desktop/Facebook/activate/node_modules/puppeteer/lib/cjs/puppeteer/common/AriaQueryHandler.js:86:3)
at Module._compile (module.js:642:30)
at Object.Module._extensions..js (module.js:653:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Module.require (module.js:586:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/yghonem/Desktop/Facebook/activate/node_modules/puppeteer/lib/cjs/puppeteer/common/QueryHandler.js:19:31)
I don't know why this error and I searched a lot but didn't find someone that faced the same error as I am