Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

288
Views
How to use electron as gui to run puppeteer script

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!