Error with Puppeteer's Locator.race during ESM migration

Switching Puppeteer from CommonJS to ESM now throws a TypeError in Locator.race. How can this issue be resolved without overhauling all tests? Sample approach:

import pageDriver from 'browser-core';

(async () => {
  const engine = await pageDriver.startEngine();
  const view = await engine.openTab();

  await pageDriver.ElementGroup.combine([
    view.findItem('header > a:first-child'),
    view.findItem('.nav-link')
  ])
    .setDuration(30000)
    .triggerAction();
})();

i encountered a similar issue. updating puppeteer to the latest version fixed my problem. in the meantime, i patched the locator by swapping out the faulty race call with an equivalent dynamic import work-a-round. hope that helps

Encountering issues like this during migration can be challenging. I ran into a similar problem during my own transition to ESM and found that the error was due to how the module was being imported, particularly impacting the race function. I resolved it by introducing a small wrapper that ensured the proper module resolution order without major refactoring. Adjusting the import at a specific stage seemed to bypass the conflict and allowed the tests to run as expected. Although not a universal fix, this incremental approach worked well in my project.