cypress
cypress copied to clipboard
Installation Error: Your Project does not contain a default SupportFile
Current behavior
When I try to configure E2E testing in the Cypress environment, I get an error. I click the button to configure and an error appears.
First 'Initializing Config...' is displayed and then the error appears or now the loading circle is displayed all the time. Unfortunately, the help does not help me. What to do here?
Debug logs
No response
Cypress Version
10.3.1
Package Manager
npm
Operating system
Windows
Other
Windows: 10 npm: 8.5.5 node: 16.13.0
@FerdinandFidel thanks for reaching out. There could be a few things causing that error:
- You don't have a file at
<project_root>/cypress/support/e2e.{js,jsx,ts,tsx}
. By default, Cypress expects that file to exist (and should create one if it does not exist during E2E setup). - Cypress has some known issues around file lookups and pathing in Windows. If the file exists at that location, Cypress could just be failing to find it.
Could you run Cypress in debug mode mode and print the entire set of logs here? It would also be helpful if we could see your project or an otherwise minimal reproduction to rule out other config-related problems.
@tbiethman Yes, it is right,, the folder <project_root>/cypress/support/* is not created by cypress. In other installations, this was generated automatically. I copied the folder from an older installation with e2e.js, but it doesn't work either.
Not sure how to run cypress in debug mode with the command line interface? And what do you need to know about the project, the package.json file?
Sorry, I gave you the wrong link related to the DEBUG logs: https://docs.cypress.io/guides/references/troubleshooting#Print-DEBUG-logs
You just need to set the DEBUG env with the cypress namespace prior to execution. How you do so on windows will depend on what shell you're using. With Powershell, I think you can do $Env:DEBUG = 'cypress:*'
to set it.
And what do you need to know about the project, the package.json file?
It'd be most helpful if you could provide a minimal project that exhibits the issues you're seeing. We have a test project repo that you can easily fork and modify for that purpose. Here are some tips for providing a Short, Self Contained, Correct, Example.
Here are the logs: log_1659079349.txt
What should I do with the fork? The error occurs when Cypress is installed and then the configuration is started with Cypress open.
With the fork, I'm really just looking for a simple project that exhibits the error you're seeing when you run it. When I pull it down and run it, it will either:
- Also fail for me, at which point I can debug further
- Work for me, at which point we can try and determine differences in our environments that are causing the failure
I do see something strange in your logs regarding our config loading process though:
cypress:lifecycle:ProjectConfigIpc fork child process {
CHILD_PROCESS_FILE_PATH: 'C:\\Users\\F\\AppData\\Local\\Cypress\\Cache\\10.3.1\\Cypress\\resources\\app\\node_modules\\@packages\\server\\lib\\plugins\\child\\require_async_child.js',
configProcessArgs: [
'--projectRoot', 'C:\\Users\\F\\PhpstormProjects\\gl_project_2\\frontend\\dashboard\\node_modules\\.bin',
'--file', 'C:\\Users\\F\\PhpstormProjects\\gl_project_2\\frontend\\dashboard\\node_modules\\.bin\\cypress.config.js'
],
childOptions: {
stdio: 'pipe',
cwd: 'C:\\Users\\F\\PhpstormProjects\\gl_project_2\\frontend\\dashboard\\node_modules\\.bin',
execPath: 'C:\\Program Files\\nodejs\\node.exe'
}
} +0ms
Those args paths aren't anywhere close to correct, which would explain the lookup failure. I'll continue to investigate.
Oh nice. Yes the fork, is some easy state form the faulty projects, too.
@FerdinandFidel can you confirm:
- the exact command you're executing when you see this error
- the directory in which you're executing the command above, relative to your project root (which I assume is
C:\\Users\\F\\PhpstormProjects\\gl_project_2\\frontend\\dashboard
based on the logs) - the shell you're using in Windows (Powershell, git bash, cmd, other?)
I've been unable to recreate the incorrect paths that your logs show, I'm wondering if we're trying to run Cypress in different ways.
I run the command in powershell:
PS C:\Users\F\PhpstormProjects\gl_project_2\frontend\dashboard\node_modules.bin> ./cypress open or PS C:\Users\F\PhpstormProjects\gl_project_2\frontend\dashboard\node_modules.bin> ./cypress run
@FerdinandFidel what happens if you are in the dashboard
directory and invoke cypress via npx?
PS C:\Users\F\PhpstormProjects\gl_project_2\frontend\dashboard npx cypress open
I don't expect this to be highly different but want to rule it out..
@AtofStryker Thanks, this works, maybe you give a hint here: https://docs.cypress.io/guides/getting-started/installing-cypress#npm-install - that the app can be opened in different ways, as described here: https://docs.cypress.io/guides/getting-started/opening-the-app. My guide to installation was the video.
@AtofStryker Thanks, this works, maybe you give a hint here: https://docs.cypress.io/guides/getting-started/installing-cypress#npm-install - that the app can be opened in different ways, as described here: https://docs.cypress.io/guides/getting-started/opening-the-app. My guide to installation was the video.
If I understand you correctly, are you saying that PS C:\Users\F\PhpstormProjects\gl_project_2\frontend\dashboard npx cypress open
works, but PS C:\Users\F\PhpstormProjects\gl_project_2\frontend\dashboard\node_modules.bin> ./cypress open
does not for you? I want to make sure we are on the same page 😃.
Yes, that is correct.
Yes, that is correct.
Now that is interesting. Hopefully early next week I can see if I can reproduce this in powershell on a windows machine. I am guessing as a working around in the meantime you are run npx
in the dashboard
directory?
Yes, now i use the npx command in the dashboard directory.
I created a reproduction repository here. I wasn't able to get the support file issue, but I did get path issues trying to resolve my config. Going to mark this as reproducible/bug.
My guess moving forward is that we may not support running directly in the bin directory directly (it might work, but we won't guarantee it). We likely need to update our documentation/videos to a more recent video of cypress CLI that includes using npx
to invoke the binary.
Just uninstalled the cypress. Deleted the file and folders it generated and then again run the command to install cypress. Then I run just put cypress in my pakcage.json file of react project created by CRA:
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-app-rewired eject",
"cypress": "cypress open"
},
and run "npm run cypress" in the terminal and cypress just ran, and them I click on the component testing and then cypress just setup all the files and folders on my project automatically, and all went good Thanks @FerdinandFidel
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.
This issue has been closed due to inactivity.
The same error (Mac OS Ventura 13.6.1 (22G313), npm installed, zsh shell):
@9inebar , did you try adding e2e.ts
in your cypress/support folder :
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')
@9inebar , did you try adding
e2e.ts
in your cypress/support folder :// *********************************************************** // This example support/e2e.ts is processed and // loaded automatically before your test files. // // This is a great place to put global configuration and // behavior that modifies Cypress. // // You can change the location of this file or turn off // automatically serving support files with the // 'supportFile' configuration option. // // You can read more here: // https://on.cypress.io/configuration // *********************************************************** // Import commands.js using ES2015 syntax: import './commands' // Alternatively you can use CommonJS syntax: // require('./commands')
I already have both commands.ts
and e2e.ts
in the same folder and unfortunately I can still reproduce the original error.
Edit: I just deleted all my cypress files including the config and re-installed from scratch. This was able to remove the error at least.
I realised I faced the same issue when I added the cypress.config.ts
file before running the cypress open for the first time. I stopped having the issue when I deleted the cypress.config.ts
file and run the cypress open command so that the config file was generated automatically.