Skip to content

Require playwright-core 1.62+, where asLocator now lives - #131

Merged
DavertMik merged 1 commit into
mainfrom
fix/playwright-162-aslocator
Aug 22, 2026
Merged

Require playwright-core 1.62+, where asLocator now lives#131
DavertMik merged 1 commit into
mainfrom
fix/playwright-162-aslocator

Conversation

@DavertMik

@DavertMik DavertMik commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

main, #129 and #130 all fail the same twelve renderCall tests. None of them caused it.

error: Playwright output is not compatible with this Playwright version
(playwright-core/lib/utils does not expose asLocator)
  at getAsLocator (src/playwright-recorder.ts:20)

Cause

Playwright 1.62 dropped lib/utils from playwright-core and moved the isomorphic helpers into lib/coreBundle, which the package publicly exports:

"exports": { "./lib/coreBundle": "./lib/coreBundle.js", ... }

asLocator now lives there under iso. The recorder still required playwright-core/lib/utils.

package.json asked for playwright ^1.62 but never for playwright-core, so the copy at the root of the tree was whatever satisfied @axe-core/playwright's playwright-core >= 1.0.0 peer. A fresh install dedupes it to 1.62.1 and CI goes red; a tree still holding an older copy resolves lib/utils and passes. That is the whole CI-vs-local split, and it made the break invisible during development.

Change

  • package.jsonplaywright-core: ^1.62 as a direct dependency, so the root copy is the one the recorder is written against.
  • src/playwright-recorder.tsgetAsLocator() reads iso.asLocator from lib/coreBundle. One entry point, no version ladder.
const asLocator = nodeRequire('playwright-core/lib/coreBundle')?.iso?.asLocator;

Explorbot supports Playwright 1.62+.

Verification

With playwright-core@1.62.1 now at the root, the local tree is the same one CI builds — no simulation involved:

bun test tests/unit/ 1022 pass · bun test tests/integration/ 80 pass, 1 skip (live-session test) · lint clean · format clean · build:npm ok.

The twelve renderCall tests are the regression guard — they fail the moment asLocator cannot be reached.

Merging this turns #129 and #130 green too.

🤖 Generated with Claude Code

Playwright 1.62 dropped lib/utils from playwright-core and moved the
isomorphic helpers into lib/coreBundle, exported as ./lib/coreBundle with
asLocator under the iso namespace. The recorder still required
playwright-core/lib/utils, so it threw PLAYWRIGHT_INCOMPATIBLE and every
renderCall test failed.

package.json asked for playwright ^1.62 but never for playwright-core, so the
copy at the root of the tree was whatever satisfied @axe-core/playwright's
playwright-core >= 1.0.0 peer. A fresh install deduped it to 1.62.1 and CI
went red, while a tree still holding an older copy resolved lib/utils and
passed — which is why this never showed up locally.

playwright-core ^1.62 is now a direct dependency, so the root copy is the one
the recorder is written against, and getAsLocator reads iso.asLocator from
lib/coreBundle and nothing else.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@DavertMik
DavertMik force-pushed the fix/playwright-162-aslocator branch from 16ac75f to 687ae50 Compare August 22, 2026 00:25
@DavertMik DavertMik changed the title Find asLocator wherever the installed playwright-core keeps it Require playwright-core 1.62+, where asLocator now lives Aug 22, 2026
@DavertMik
DavertMik merged commit b362c6f into main Aug 22, 2026
2 checks passed
@DavertMik
DavertMik deleted the fix/playwright-162-aslocator branch August 22, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants