Skip to content

Playwright Generated E2E Targets gets cached when it shouldn't #35008

@estiller

Description

@estiller

Current Behavior

In a Playwright E2E project, the E2E target is generated as cacheable, but with the wrong inputs.

? ['default', '^{projectRoot}/tsconfig*.json', '^production']

It seems like defining ['default', '^{projectRoot}/tsconfig*.json', '^production'] causes the target not to depend on the actual ^production files. Instead, it only depends on '^{projectRoot}/tsconfig*.json' from the dependent projects, and that's it.

When you look at the task in nx graph, it seems ok:
Image

But when you look at the actual file list, you see it only depends on the .tsconfig files without any the source files:
Image

As a result, the E2E result is taken from cache even if the dependencies' code has changed.

Expected Behavior

The generated E2E project should depend on the actual files from ^production.

GitHub Repo

No response

Steps to Reproduce

  1. Create a Playwright E2E test project.
  2. Add an implicit dependency to another project.
  3. Run the E2E.
  4. Change a code file.
  5. Run the E2E again - the cache will be used.

Nx Report

❯ pnpm nx report

 NX   Report complete - copy this into the issue template

Node           : 24.14.0
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 10.32.1
daemon         : Available

nx                     : 22.6.1
@nx/js                 : 22.6.1
@nx/eslint             : 22.6.1
@nx/workspace          : 22.6.1
@nx/jest               : 22.6.1
@nx/devkit             : 22.6.1
@nx/eslint-plugin      : 22.6.1
@nx/module-federation  : 22.6.1
@nx/nest               : 22.6.1
@nx/next               : 22.6.1
@nx/node               : 22.6.1
@nx/playwright         : 22.6.1
@nx/plugin             : 22.6.1
@nx/react              : 22.6.1
@nx/rollup             : 22.6.1
@nx/rspack             : 22.6.1
@nx/vite               : 22.6.1
@nx/vitest             : 22.6.1
@nx/web                : 22.6.1
@nx/webpack            : 22.6.1
@nx/docker             : 22.6.1
typescript             : 5.9.3

---------------------------------------
Nx key licensed packages
Licensed to XXX.

@nx/s3-cache  : 5.0.2

---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/jest/plugin
@nx/webpack/plugin
@nx/rspack/plugin
@nx/next/plugin
@nx/js/typescript
@nxlv/python
@nx/playwright/plugin
@nx/js/typescript
---------------------------------------
Community plugins:
@nx-tools/nx-container : 7.2.1
@nx/s3-cache           : 5.0.2
@nxlv/python           : 22.1.1
---------------------------------------
Local workspace plugins:
@application/nx-plugin
---------------------------------------
Cache Usage: 15.03 MB / 92.64 GB

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

When I add the following in nx.json under targetDefaults, I can workaround it and the inputs are calculated correctly:

    "e2e": {
      "inputs": ["default", "^production"]
    }

Metadata

Metadata

Assignees

Labels

outdatedpriority: highHigh Priority (important issues which affect many people severely)scope: testing toolsIssues related to Cypress / Jest / Playwright / Vitest support in Nxtype: bug

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions