nextjs - 💡(How to fix) Fix experimental testmode playwright textProxy defineConfig ignores projects even when --project=chromium is passed [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#86109Fetched 2026-04-08 02:12:35
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×2closed ×1commented ×1issue_type_added ×1

Error Message

When I try to install browsers with pnpm exec playwright install --with-deps instead, I don't get the error but now playwright is running against firefox and webkit as well.

Code Example

projects: [
    {
      name: "chromium",
      use: {
        ...devices["Desktop Chrome"],
        launchOptions: { args: ["--ignore-certificate-errors"] },
      },
    },
  ],

---

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 13th Gen Intel(R) Core(TM) i7-1365U
    Memory: 341.79 MB / 15.67 GB
  Binaries:
    Node: 22.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.15.5 - C:\Program Files\nodejs\pnpm.CMD
  IDEs:
    VSCode: 1.105.1 - C:\Users\NoelStephan\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 5.1.16 - C:\WINDOWS\system32\bash.EXE
  npmPackages:
    @playwright/test: ^1.56.1 => 1.56.1

 
Relevant Packages: 
  next: 16.0.1
  @playwright/test: 1.56.1
  
Next.js Config: 

  const nextConfig: NextConfig = {
  output: "standalone",
  transpilePackages: ["@workspace/auth"],
  serverExternalPackages: ["@aws-crypto"],
  experimental: {
    testProxy: true,
  },
  }
  
Playwright Config projects: 

  projects: [
    {
      name: "chromium",
      use: {
        ...devices["Desktop Chrome"],
        // TODO Not sure if we need to ignore certificate errors
        launchOptions: { args: ["--ignore-certificate-errors"] },
      },
    },
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

coming up

To Reproduce

Update playwright from v 1.50.1 to 1.56.1 Run playwright on Github Actions using playwright test --config ./e2e/playwright.config.ts or playwright test --config ./e2e/playwright.config.ts --project=chromium

Browsers are installed with pnpm exec playwright install chromium --with-deps

My projects config has the following:

projects: [
    {
      name: "chromium",
      use: {
        ...devices["Desktop Chrome"],
        launchOptions: { args: ["--ignore-certificate-errors"] },
      },
    },
  ],

I get the following:

<img width="1348" height="765" alt="Image" src="https://github.com/user-attachments/assets/9c07967c-37c6-46bb-b49e-858104859cc6" />

When I try to install browsers with pnpm exec playwright install --with-deps instead, I don't get the error but now playwright is running against firefox and webkit as well.

I remove experimental testmode from my NextJS project and the problem goes away.

Current vs. Expected behavior

Expected

Expected playwright to only run the tests for projects in my playwright config even with experimental test mode.

Current

Tests are running even for browsers not defined in my playwright config.

Provide environment information

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 13th Gen Intel(R) Core(TM) i7-1365U
    Memory: 341.79 MB / 15.67 GB
  Binaries:
    Node: 22.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.15.5 - C:\Program Files\nodejs\pnpm.CMD
  IDEs:
    VSCode: 1.105.1 - C:\Users\NoelStephan\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 5.1.16 - C:\WINDOWS\system32\bash.EXE
  npmPackages:
    @playwright/test: ^1.56.1 => 1.56.1

 
Relevant Packages: 
  next: 16.0.1
  @playwright/test: 1.56.1
  
Next.js Config: 

  const nextConfig: NextConfig = {
  output: "standalone",
  transpilePackages: ["@workspace/auth"],
  serverExternalPackages: ["@aws-crypto"],
  experimental: {
    testProxy: true,
  },
  }
  
Playwright Config projects: 

  projects: [
    {
      name: "chromium",
      use: {
        ...devices["Desktop Chrome"],
        // TODO Not sure if we need to ignore certificate errors
        launchOptions: { args: ["--ignore-certificate-errors"] },
      },
    },

Which area(s) are affected? (Select all that apply)

Testing

Which stage(s) are affected? (Select all that apply)

next build (local), next start (local)

Additional context

Seems like it could be a problem with the defineConfig exported from experimental testmode. But even when running playwright with --project=chromium it ran for other browsers, so not sure.

import { defineConfig } from "next/experimental/testmode/playwright.js";

extent analysis

TL;DR

The issue can be fixed by disabling the experimental test mode in Next.js or by configuring Playwright to only run tests for the specified project.

Guidance

  • The problem seems to be related to the experimental test mode in Next.js, which is causing Playwright to run tests for all browsers, not just the ones defined in the Playwright config.
  • Try disabling the experimental test mode in Next.js by removing the experimental property from the nextConfig object or setting testProxy to false.
  • Verify that Playwright is only running tests for the specified project by checking the test output and ensuring that only the tests for the "chromium" project are being executed.
  • If the issue persists, try running Playwright with the --project flag to specify the project to run tests for, e.g., playwright test --config ./e2e/playwright.config.ts --project=chromium.

Example

No code snippet is provided as the issue is more related to configuration and setup.

Notes

The issue seems to be specific to the combination of Next.js experimental test mode and Playwright. Disabling the experimental test mode or configuring Playwright to only run tests for the specified project should resolve the issue.

Recommendation

Apply workaround: Disable the experimental test mode in Next.js or configure Playwright to only run tests for the specified project, as this seems to be the most straightforward solution to the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING