Repository navigation
Description
What version of the Codex App are you using?
26.818.5345.0
Detected through Get-AppxPackage -Name OpenAI.Codex.
What subscription do you have?
Pro
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
The persistent node_repl tool cannot dynamically import Playwright because its module loader does not provide Node-compatible default interoperability when an ES module imports a CommonJS module.
The following expression fails inside mcp__node_repl__js:
await import("playwright");Error:
The requested module './index.js' does not provide an export named 'default'
This is not a missing package or incompatible Node runtime:
- Playwright
1.62.1is installed and discoverable bynode_repl. js_add_node_module_diraccepts the package'snode_modulesdirectory.- The exact Node executable bundled with Codex successfully imports the same package.
- Loading Playwright through Node's
createRequire()succeeds inside the same persistent REPL. - No browser launch is required to reproduce the failure.
The failing interoperability boundary can be isolated to playwright-core/index.mjs, which contains:
import playwright from './index.js';./index.js is CommonJS. Native Node provides module.exports as the default import, while the node_repl loader reports that no default export exists.
What steps can reproduce the bug?
Environment:
- Codex App:
26.818.5345.0 - Platform: Windows 11 x64
- Embedded Node:
v24.19.0 - Playwright:
1.62.1 - Sandbox mode:
danger-full-access - Session ID:
01a02f5d-2d16-7511-86f7-d1b384135e9d
- Create a temporary package and install Playwright:
mkdir playwright-repro
cd playwright-repro
pnpm init
pnpm add --save-dev playwright@1.62.1- Verify that the Codex-bundled Node executable imports it successfully:
& "$env:LOCALAPPDATA\OpenAI\Codex\runtimes\cua_node\<runtime-hash>\bin\node.exe" `
-e "import('playwright').then((module) => console.log({ chromium: !!module.chromium, hasDefault: !!module.default }))"Observed output:
{ chromium: true, hasDefault: true }
- Add the temporary package's absolute
node_modulesdirectory throughmcp__node_repl__js_add_node_module_dir.
The tool returns successfully.
- In
mcp__node_repl__js, run:
await import("playwright");Observed error:
The requested module './index.js' does not provide an export named 'default'
- The failure can be isolated by importing Playwright Core's ESM entry directly:
await import(
"file:///C:/path/to/node_modules/playwright-core/index.mjs"
);Observed error:
The requested module './index.js' does not provide an export named 'default'
- Loading the same package through Node's CommonJS loader succeeds inside
node_repl:
var moduleBridge = await import("node:module");
var nodeRequire = moduleBridge.createRequire(
"C:/path/to/playwright-repro/package.json"
);
var playwrightViaRequire = nodeRequire("playwright");
nodeRepl.write({
chromium: !!playwrightViaRequire.chromium
});Observed output:
{ chromium: true }
What is the expected behavior?
await import("playwright") inside node_repl should behave like the same dynamic import executed by the bundled Node runtime.
When an ES module default-imports a CommonJS module, node_repl should implement Node-compatible interoperability and expose module.exports as the default export.
Ideally, node_repl should delegate module evaluation to Node's native ESM loader rather than implementing different CommonJS interoperability semantics.
Additional information
Playwright's package exports correctly distinguish between ESM and CommonJS entry points:
{
"exports": {
".": {
"import": "./index.mjs",
"require": "./index.js",
"default": "./index.js"
}
}
}The root Playwright ESM entry is selected, but importing eventually reaches this statement in playwright-core/index.mjs:
import playwright from './index.js';That CommonJS default import is where node_repl fails.
The closest existing issue is #31780:
That issue concerns a mismatch between Playwright and installed Chromium revisions. Its await import("playwright") call succeeds, whereas this report fails before browser launch, so the two issues appear distinct.
Temporary workaround:
var moduleBridge = await import("node:module");
var nodeRequire = moduleBridge.createRequire(
"C:/path/to/playwright-repro/package.json"
);
var playwright = nodeRequire("playwright");
Activity
th3nolo commentedon Aug 29, 2026
Independent reproduction on a newer Windows Desktop build, with an important impact correction after end-to-end Browser Plugin validation.
Environment:
26.825.4187.010.0.26200.9278x64gpt-5.6-solworkspace_kind=projectless)workspace-write7.6.4node_repl: enabled and callable (node_repl_disabled=false)After a clean
mcp__node_repl__js_reset, the direct import still fails:Observed:
This confirms the CommonJS interoperability bug persists on AppX
26.825.4187.0and underworkspace-write.However, this does not block the normal Browser Plugin workflow in this build. The plugin's packaged entry point is
scripts/browser-client.mjs, not a direct Playwright import. Using that entry point:setupBrowserRuntime()completed.agent.browsers.getDefault()selected the Codex in-app browser.browser.user.openTabs()returned the two visible tabs.tab.playwright.domSnapshot()succeeded.The issue therefore remains valid for direct ESM-to-CommonJS interoperability, but its impact should not be interpreted as proof that Browser Plugin control is unavailable. Loading bundled Playwright with
createRequire()also succeeds, although it was not needed for the supported Browser Plugin path.lymiran commentedon Sep 27, 2026
Reproduced on a newer Windows desktop build with the bundled Browser plugin explicitly selected.
Environment:
26.924.2738.0(x64)0.158.0-alpha.2.1playwright/playwright-core:1.57.0@BrowserMinimal failure inside the Browser-associated persistent Node REPL:
Observed:
The same error occurs with
await import("playwright-core"). Resetting the Node REPL kernel and retrying once does not change the result. Inspection showsplaywright-core/index.mjsdefault-importing the bundled CommonJS./index.js, matching this issue's interoperability boundary. The failure happens before a page or browser target is opened, so it is independent of website permissions, login state, cookies, or the target site.No application files or bundled packages were modified while reproducing.