-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
Description
Version
1.43.1 - 1.44.1
Steps to reproduce
- Clone https://github.com/MindaugasMateika/pw-braze-esm
npm installnpx playwright installnpx playwright test
Expected behavior
Expected tests to pass
Actual behavior
Throws an error
Error: require() of ES Module /Users/mindaugas.mateika/pw-braze-esm/node_modules/@braze/web-sdk/src/index.js from /Users/mindaugas.mateika/pw-braze-esm/load-braze.cjs not supported.
Instead change the require of index.js in /Users/mindaugas.mateika/pw-braze-esm/load-braze.cjs to a dynamic import() which is available in all CommonJS modules.
at ../load-braze.cjs:10
8 |
at /Users/mindaugas.mateika/pw-braze-esm/load-braze.cjs:10:63
at /Users/mindaugas.mateika/pw-braze-esm/async /Users/mindaugas.mateika/pw-braze-esm/tests/example.spec.ts:9:3
at /Users/mindaugas.mateika/pw-braze-esm/async /Users/mindaugas.mateika/pw-braze-esm/node_modules/playwright/lib/worker/workerMain.js:336:9
at /Users/mindaugas.mateika/pw-braze-esm/async /Users/mindaugas.mateika/pw-braze-esm/node_modules/playwright/lib/worker/testInfo.js:297:11
at /Users/mindaugas.mateika/pw-braze-esm/async /Users/mindaugas.mateika/pw-braze-esm/node_modules/playwright/lib/worker/workerMain.js:328:7
at /Users/mindaugas.mateika/pw-braze-esm/async /Users/mindaugas.mateika/pw-braze-esm/node_modules/playwright/lib/worker/testInfo.js:297:11
Additional context
While attempting to import the ES Module @braze/web-sdk dynamically in a CommonJS setup, an error is encountered with a specific versions of Playwright. The issue does not occur with older versions of Playwright like 1.42.1 and below.
1.41.1 - works
1.42.1 - works
1.43.1 - error
1.44.1 - error
Environment
System:
OS: macOS 14.4
CPU: (12) arm64 Apple M2 Pro
Memory: 176.83 MB / 32.00 GB
Binaries:
Node: 20.11.0 - ~/.local/share/mise/installs/node/20.11.0/bin/node
npm: 10.2.4 - ~/.local/share/mise/installs/node/20.11.0/bin/npm
pnpm: 8.7.4 - ~/.local/share/mise/installs/pnpm/8.7.4/bin/pnpm
Languages:
Bash: 5.2.26 - /opt/homebrew/bin/bash
npmPackages:
@playwright/test: 1.44.1 => 1.44.1Reactions are currently unavailable