Skip to content

Cypress Github Action and Vite config import all of a sudden failing in CI/CD runs #31369

Closed
@reintroducing

Description

@reintroducing

Current behavior

Four days ago we had complete support when using the Cypress GH action and everything was working as expected. Then, the next day, a run that changed nothing in relation to any of the aforementioned files, started failing (and every subsequent run after that):
Image

When digging into the error, this is what we're seeing:
Image

Test run fine and as expected when run locally, only in GHA do they fail in this manner.

Desired behavior

This is the last run that was successful and the logging that was produced in the same spot:
Image

Test code to reproduce

Unfortunately as this is in a CI/CD run, I don't have a repro.

Cypress Version

14.2.0

Node version

22.13.0

Operating System

ubuntu-latest

Debug Logs

Run cypress-io/github-action@v6
  with:
    component: true
    install: false
    record: false
    publish-summary: true
Skipping install because install parameter is false
It looks like this is your first time using Cypress: 13.17.0

[STARTED] Task without title.
[SUCCESS] Task without title.

Opening Cypress...

DevTools listening on ws://127.0.0.1:39921/devtools/browser/edb7e2c6-1894-491c-99f3-04b73b473104
(node:2408) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///home/runner/.cache/Cypress/13.17.0/Cypress/resources/app/node_modules/ts-node/esm/transpile-only.mjs", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
Your configFile is invalid: /home/runner/work/vr-web-ui/vr-web-ui/cypress.config.ts

It threw an error when required, check the stack trace below:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/runner/work/vr-web-ui/vr-web-ui/vite.config' imported from /home/runner/work/vr-web-ui/vr-web-ui/cypress.config.ts
    at finalizeResolution (node:internal/modules/esm/resolve:283:11)
    at moduleResolve (node:internal/modules/esm/resolve:952:10)
    at defaultResolve (node:internal/modules/esm/resolve:1188:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:642:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:591:25)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:347:53)
    at new ModuleJobSync (node:internal/modules/esm/module_job:333:34)
    at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:320:11)
    at loadESMFromCJS (node:internal/modules/cjs/loader:1371:24)
    at Module._compile (node:internal/modules/cjs/loader:1511:5)
    at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
    at Module.load (node:internal/modules/cjs/loader:1275:32)
    at Module._load (node:internal/modules/cjs/loader:1096:12)
    at Module.require (node:internal/modules/cjs/loader:1298:19)
    at require (node:internal/modules/helpers:182:18)
    at loadFile (/home/runner/.cache/Cypress/13.17.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)
Test run failed, code 1
More information might be available above
Cypress module has returned the following error message:
Could not find Cypress test run results
Error: Could not find Cypress test run results

Other

This is the code for the quality gate job:

name: Quality Gate

on: push

jobs:
  quality:
    runs-on: ubuntu-latest
    steps:
      - name: Check out the repository
        uses: actions/checkout@v4
      - name: Set up node
        uses: actions/setup-node@v4
        with:
          node-version-file: .nvmrc
      - name: Install npm dependencies
        run: npm ci
      - name: Run linters
        uses: rkuykendall/lint-action@master
        with:
          continue_on_error: false
          eslint: true
          eslint_extensions: 'js,jsx,ts,tsx'
          prettier: true
          # We can't use this yet as we have too many issues to fix
          # tsc: true
          # tsc_extensions: 'ts,tsx'
      - name: Run component tests
        uses: cypress-io/github-action@v6
        with:
          component: true
          install: false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions