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

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 15 (8 by maintainers)

Most upvoted comments

@reintroducing

I was able to test my repro successfully with Cypress 14.2.1 which was just released.

Please let us know if updating to this version resolves your issue.

@MikeMcC399 Just updated and can confirm that the runs are now passing. Thank you!

@DenisHdz

Also, how can we tell which Node version the runner uses? The setup job only logs this:

Current runner version: '2.323.0'
Operating System
  Ubuntu
  [2](https://github.com/x/x/actions/runs/14077865329/job/39424081437#step:1:2)4.04.2
  LTS
Runner Image
  Image: ubuntu-24.04
  Version: 20250[3](https://github.com/x/x/actions/runs/14077865329/job/39424081437#step:1:3)16.1.0
  Included Software: https://github.com/actions/runner-images/blob/ubuntu2[4](https://github.com/x/x/actions/runs/14077865329/job/39424081437#step:1:4)/20250316.1/images/ubuntu/Ubuntu2404-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F202[5](https://github.com/x/x/actions/runs/14077865329/job/39424081437#step:1:5)0316.1
Runner Image Provisioner
  2.0.422.1

@MikeMcC399 ah, yep, that is exactly the issue then, i’m seeing '2.323.0'. Thank you! I will await the fix then as I would rather not make changes that are not long term necessary. our tests failing in CI/CD are not mission critical at the moment as we release every two weeks and I know they work fine locally, so I’ll hold off until the next release of Cypress fixes this. Appreciate the quick response on this from the both of you.

For us it works too πŸŽ‰ thank you!

@DenisHdz

@MikeMcC399 If we use the actions/setup-node@v4 action to setup the version of Node that we want, as @reintroducing is doing from the snippet he shared above, why the Cypress cypress-io/github-action@v6 is not picking up this one but instead, the one from the runner?

This is the way that all JavaScript GitHub Actions work and it is explained briefly in https://github.com/cypress-io/github-action/blob/master/README.md#usage

The only valid value for runs.using is currently node20 and this forces the use of the Node.js version specified in

https://github.com/actions/runner/blob/d8b82f44a9ec0258904d5869ae683c31d5aac299/src/Misc/externals.sh#L9

NODE20_VERSION="20.19.0"

There is no choice about this version and it is not affected by actions/setup-node

Also, how can we tell which Node version the runner uses? The setup job only logs this:

Current runner version: β€˜2.323.0’

In the case of a Cypress test which does not fail to load the Cypress config file, the Node.js version is shown in the Cypress test summary

  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ Cypress:        14.2.0                                                                         β”‚
  β”‚ Browser:        Electron 130 (headless)                                                        β”‚
  β”‚ Node Version:   v20.19.0 (/home/runner/runners/2.323.0/externals/node20/bin/node)              β”‚
  β”‚ Specs:          1 found (spec.cy.js)                                                           β”‚
  β”‚ Searched:       cypress/e2e/**/*.cy.{js,jsx,ts,tsx}                                            β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

I could not find anywhere in the logs (not even if debug is enabled) where the JavaScript Action version of Node.js is shown if the test fails to start because of a config file issue.

@WtfJoke

@jennifer-shehane @MikeMcC399 do you know if a release today will happen?

Currently our pipelines are blocked and if we dont need to implement the workaround and instead just update cypress, that would be great for us.

@reintroducing

Could you please open up your logs and check β€œCurrent runner version”. If you are seeing 2.323.0 then you have been bumped to using Node.js 20.19.0. The screen shot below shows a repo which has not yet been updated.

Image

You can find a workaround in the above issue where other users have successfully applied environment variables

        env:
          NODE_OPTIONS: "--no-experimental-require-module --no-experimental-detect-module"