AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Next.Js Testmode Playwright DefineConfig Forces Default Projects And Ignores User Overrides

The `defineConfig` wrapper from `next/experimental/testmode/playwright` always merges the built-in default browser projects (chromium, firefox, webkit) with any user-defined `projects`, preventing users from overriding the project list. This causes unwanted browser projects to run and may fail if those browsers are not installed.

highConfidence 88%Next.jsApp RouterPages RouterRoute HandlersAffected V16.2.12

Origin Analysis

The Next.js `defineConfig` implementation concatenates the default `projects` array with the user-provided `projects` array instead of allowing the user array to replace the defaults when present.
1. Create a Next.js app and configure `playwright.config.ts` using `defineConfig` from `next/experimental/testmode/playwright` with `projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }]`.\n2. Install only Chromium via `npx playwright install chromium --with-deps`.\n3. Run `npx playwright test`.\n4. Observe that 4 projects are executed: `chromium`, `firefox`, `webkit` (from defaults) plus `chromium` (from user config), and tests fail on `firefox` and `webkit` with browser not found.

Fixing Code Block

Edge Case Audit

Existing users who relied on the previous concatenation behavior to run default browsers alongside their custom projects will lose the default projects after this fix. If such behavior is desired, they must explicitly include the default browser projects in their config. An empty `projects` array (`projects: []`) will now result in no projects being run, which may cause Playwright to error; to use defaults, the `projects` key should be omitted entirely. This change should be rolled back if test suites are found to depend on the merged project list, and users can instead manually add the default browser projects to their configuration.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state