github-action: Could not find a Cypress configuration file. We looked but did not find a cypress.json file in this folder.

As of late last week, Cypress tests are failing with this error, from one commit to the next, which was completely unrelated (an .md file). I seem to be getting the same error as @jazanne from this comment.

We’re using:

  • cypress-io/github-action@v2
  • Cypress v9.7.0
  • Yarn Berry v3

I tried @jazanne’s workaround, sadly we’re still getting the same error regardless. We’ve tried upgrading cypress, using cypress-io/github-action@v3, and running it headlessly. In one separate PR I even tried to downgrade to yarn 1.x, which is causing some other errors. The whole JS toolchain seems so brittle. 😒 Is anyone else getting this? Any suggestions?

[STARTED] Task without title.
[SUCCESS] Task without title.
[494:0606/101147.234717:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[494:0606/101147.234801:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[494:0606/101147.234809:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[494:0606/101147.234815:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[655:0606/101148.920788:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[655:0606/101148.926474:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
Could not find a Cypress configuration file.
We looked but did not find a cypress.json file in this folder: /__w/kaoto-ui/kaoto-ui
Error: The process '/usr/local/bin/npx' failed with exit code 1

cc @delawen

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 24
  • Comments: 53

Most upvoted comments

Any solutions yet?? Seems like this is a wide issue as of now with cypress v10+.

@SparrowBrain Thanks for sharing a link to your workflow logs. I had the same issue. In both our cases, you can see in the workflow logs that the config-file was set as cypress.json by default. According to the Cypress docs

Version Changes
10.0.0 Reworked page to support new cypress.config.js and deprecated cypress.json files

image

I just changed the workflow to explicitly declare config-file: cypress.config.ts and it worked. In my case the CLI output was very helpful.

[percy] Running "npx cypress run --headless --config-file cypress.json --browser chrome"

You are attempting to use Cypress with an older config file: cypress.json

When you upgraded to Cypress v10.0 the config file was updated and moved to a new location: cypress.config.ts

You may need to update any CLI scripts to ensure that they are referring the new version. This would typically look something like:

"cypress open --config-file=cypress.config.ts"

https://on.cypress.io/migration-guide

Is there any updates on this issue? i am also getting error while running in docker. Cypress version: 10.3.0

image

Actually this is working after running the cypress migration. The config file is not a json anymore. It is a JS file now. All I did is running cypress open (from host machine, not from docker) to get cypress ui, and followed the migration from the UI. They migrate the cypress file for us. Then remember to use cypress run with updated flag --config-file to point to the new js file

See: https://docs.cypress.io/guides/references/migration-guide#Cypress-Changes

“You may use the --config-file command line flag or the configFile module API option to specify a .js or .ts file. JSON config files are no longer supported.”

It’s working for me after changing:

/integration/config.json

{
  "baseUrl": "http://localhost:3000",
  "ignoreTestFiles": "**/config.json",
  "video": false,
  "experimentalSessionSupport": true
}

To:

/integration/config.js

const { defineConfig } = require('cypress')

module.exports = defineConfig({
  e2e: {
    baseUrl: 'http://localhost:3000',
    supportFile: false,
    video: false,
    experimentalSessionAndOrigin: true,
    specPattern: [
      "**/*.integration.test.ts"
    ]
  }
})

npx cypress open --config-file theNewCypressConfigPath solved by this

Hi, I have a problem with finding a cypress.config.ts file. Just with npx cypress open it works fine.

The problem is when I try to do it through docker-compose. I tried to copy cypress.config.ts file to /cypress folder. I also tried to investigate Cypress docs, no success.

image

How to define a path for cypress.config.ts in docker-compose file?!

No longer having this issue, thanks @MikeMcC399

@matart15 Issue https://github.com/cypress-io/cypress/issues/25357 about the graphics error message is now routed to the Cypress e2e team.

@MikeMcC399

oh i see. i misunderstood your message. thank you for reproducable example

@MikeMcC399

I see. Thank you for explanation.

I will try running my test on CI without cypress-io/github-action. ( not sure how to do it )

thank you again

@MikeMcC399 Thank you.

Yes. Indeed I am using monorepo. I will try later and let you know the result

@matart15

  • I submitted a document change PR https://github.com/cypress-io/github-action/pull/689 so that the use of the working-directory parameter is better documented for v10 and later.
  • You should check if you really need it in your configuration.
  • It is used in all the examples in this repository and for the examples it works correctly.

@matart15

[4351:1227/131437.366155:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.

I believe that you can ignore the gpu error. I have seen successful tests which also show this error, for example run 6438334587 from this repository’s examples.

Are you also getting a message like:

“Could not find a Cypress configuration file in this folder: /home/runner/work/xxxx”

Which runner are you using?

If you use working-directory in a Cypress v10 or later Typescript environment, it should point to the directory containing cypress & cypress.config.ts. For instance, working-directory: my-test in the example below:

repo/
    app/
    my-test/
        cypress/
            e2e/
                spec.cy.ts
            fixtures/
            support/
                commands.ts
                e2e.ts
            tsconfig.json
        cypress.config.ts
        package.json

If cypress is not in a sub-directory, then you wouldn’t need to specify working-directory. See the basic example.

The documentation for working-directory might be confusing because it uses e2e for an example before Cypress v10 was released. That is not the cypress/e2e directory! Probably the documentation should be updated to give a v9 and a separate v10 and later example to be clearer.

Hi! Has anyone found a solution to this? We are running cypress in a docker container. Is it necessary to explicitly select the relevant config file?

@drecali kudos, your comment “I just changed the workflow to explicitly declare config-file: cypress.config.ts and it worked.” resolved my issue! Thank you.

any news?

Same issue.

Using:

  • cypress-io/github-action@v4
  • Cypress v10.2.0
  • npm (v8? GitHub Actions default)

Could be related to migrating to v2 of npm lockfile. Had to upgrade chokidar after migration.

The run: https://github.com/SparrowBrain/GOG-Galaxy-Suggester/runs/7009698620

Run cypress-io/github-action@v2
/usr/local/bin/npm ci
added 2420 packages, and audited 2421 packages in 55s
15 packages are looking for funding
  run `npm fund` for details
28 vulnerabilities (1 moderate, 19 high, 8 critical)
To address all issues (including breaking changes), run:
  npm audit fix --force
Run `npm audit` for details.
/usr/local/bin/npx cypress cache list
┌─────────┬───────────┐
│ version │ last used │
├─────────┼───────────┤
│ 10.2.0  │ a day ago │
└─────────┴───────────┘
/usr/local/bin/npx cypress verify
[STARTED] Task without title.
[SUCCESS] Task without title.
/usr/bin/tar --posix --use-compress-program zstd -T0 -cf cache.tzst -P -C /home/runner/work/GOG-Galaxy-Suggester/GOG-Galaxy-Suggester --files-from manifest.txt
Cache Size: ~55 MB (57565882 B)
Cache saved successfully
/usr/bin/tar --posix --use-compress-program zstd -T0 -cf cache.tzst -P -C /home/runner/work/GOG-Galaxy-Suggester/GOG-Galaxy-Suggester --files-from manifest.txt
Cache Size: ~155 MB (162987616 B)
Cache saved successfully
start server "npm start command "npm start"
current working directory "/home/runner/work/GOG-Galaxy-Suggester/GOG-Galaxy-Suggester"
waiting on "http://localhost:3000" with timeout of 60 seconds
/usr/local/bin/npm start
> gog-galaxy-suggester@0.1.0 start
> react-app-rewired start
ℹ「wds」: Project is running at http://10.1.0.152/
ℹ「wds」: webpack output is served from /GOG-Galaxy-Suggester
ℹ「wds」: Content not from webpack is served from /home/runner/work/GOG-Galaxy-Suggester/GOG-Galaxy-Suggester/public
ℹ「wds」: 404s will fallback to /GOG-Galaxy-Suggester/
Starting the development server...
Compiled successfully!
You can now view gog-galaxy-suggester in the browser.
  Local:            http://localhost:3000/GOG-Galaxy-Suggester
  On Your Network:  http://10.1.0.152:3000/GOG-Galaxy-Suggester
Note that the development build is not optimized.
To create a production build, use npm run build.
[2203:0622/174911.935964:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[2203:0622/174911.939833:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
Could not find a Cypress configuration file.
We looked but did not find a cypress.json file in this folder: /home/runner/work/GOG-Galaxy-Suggester/GOG-Galaxy-Suggester
Test run failed, code 1
More information might be available above
Error: Could not find Cypress test run results
Cypress module has returned the following error message:
Could not find Cypress test run results

The file has to be there, since github checkout points to the same folder