Skip to content

[Bug]: zx import failure when run through playwright CLI #35812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jasonkuhrt opened this issue Apr 30, 2025 · 4 comments · Fixed by #35962
Closed

[Bug]: zx import failure when run through playwright CLI #35812

jasonkuhrt opened this issue Apr 30, 2025 · 4 comments · Fixed by #35962
Assignees
Labels

Comments

@jasonkuhrt
Copy link

jasonkuhrt commented Apr 30, 2025

Version

1.52.0

Steps to reproduce

In GH CI Node 22 ubuntu:

import { test } from 'playwright/test'

test('debug', async () => {
  console.log((await import(`zx`)).$)
  console.log((await import(`zx/core`)).$)
})

Expected behavior

$ is defined

Actual behavior

$ is undefined

Additional context

Environment

System:
    OS: macOS 15.4.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 2.36 GB / 32.00 GB
  Binaries:
    Node: 22.14.0 - ~/Library/pnpm/node
    npm: 10.9.2 - ~/Library/pnpm/npm
    pnpm: 10.10.0 - /opt/homebrew/bin/pnpm
  IDEs:
    VSCode: 1.99.3 - /usr/local/bin/code
  Languages:
    Bash: 5.1.16 - /opt/homebrew/bin/bash
  npmPackages:
    @playwright/browser-chromium: ^1.52.0 => 1.52.0 
    playwright: ^1.52.0 => 1.52.0
@jasonkuhrt

This comment has been minimized.

@jasonkuhrt

This comment has been minimized.

@mxschmitt
Copy link
Member

Node.js bisect range: nodejs/node@dbfcbe3...6c03beb

good v24.0.0-nightly20241209dbfcbe371c/
bad v24.0.0-nightly202412106c03beba46/

@dgozman
Copy link
Contributor

dgozman commented May 2, 2025

I can repro. This is related to our loaders. Commenting out pirates.addHook() solves the issue. Disabling ESM loader has no effect. That said, I cannot reproduce in isolation without Playwright by just calling into pirates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants