Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Error: Your Project does not contain a default SupportFile #22929

Closed
FerdinandFidel opened this issue Jul 26, 2022 · 23 comments
Closed
Labels
E2E Issue related to end-to-end testing existing workaround OS: windows Reproducible Can be reproduced stale no activity on this issue for a long period topic: installation Issue during installation or downloading Cypress type: bug

Comments

@FerdinandFidel
Copy link

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?
cypress

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 FerdinandFidel added the topic: installation Issue during installation or downloading Cypress label Jul 26, 2022
@cypress-bot cypress-bot bot added the stage: investigating Someone from Cypress is looking into this label Jul 26, 2022
@tbiethman
Copy link
Contributor

@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.

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: investigating Someone from Cypress is looking into this labels Jul 27, 2022
@FerdinandFidel
Copy link
Author

@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?

@tbiethman
Copy link
Contributor

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.

@FerdinandFidel
Copy link
Author

Here are the logs:
log_1659079349.txt

@FerdinandFidel
Copy link
Author

FerdinandFidel commented Jul 29, 2022

What should I do with the fork? The error occurs when Cypress is installed and then the configuration is started with Cypress open.

@tbiethman
Copy link
Contributor

tbiethman commented Jul 29, 2022

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.

@cypress-bot cypress-bot bot added stage: investigating Someone from Cypress is looking into this and removed stage: awaiting response Potential fix was proposed; awaiting response labels Jul 29, 2022
@FerdinandFidel
Copy link
Author

Oh nice. Yes the fork, is some easy state form the faulty projects, too.

@tbiethman
Copy link
Contributor

@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.

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: investigating Someone from Cypress is looking into this labels Aug 2, 2022
@mjhenkes mjhenkes assigned AtofStryker and unassigned tbiethman Aug 2, 2022
@FerdinandFidel
Copy link
Author

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

@AtofStryker
Copy link
Contributor

@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..

@FerdinandFidel
Copy link
Author

FerdinandFidel commented Aug 4, 2022

@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
Copy link
Contributor

@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 😃.

@FerdinandFidel
Copy link
Author

Yes, that is correct.

@cypress-bot cypress-bot bot added stage: investigating Someone from Cypress is looking into this and removed stage: awaiting response Potential fix was proposed; awaiting response labels Aug 5, 2022
@AtofStryker
Copy link
Contributor

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?

@FerdinandFidel
Copy link
Author

FerdinandFidel commented Aug 9, 2022

Yes, now i use the npx command in the dashboard directory.

@AtofStryker AtofStryker added type: bug Reproducible Can be reproduced labels Aug 11, 2022
@AtofStryker
Copy link
Contributor

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.

@cypress-bot cypress-bot bot added stage: routed to e2e-core and removed stage: investigating Someone from Cypress is looking into this stage: routed to e2e-core labels Aug 12, 2022
@mschile mschile added triage and removed triage labels Aug 18, 2022
@nagash77 nagash77 added E2E Issue related to end-to-end testing and removed E2E-core labels Nov 8, 2022
@shoaibshebi
Copy link

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

@cypress-app-bot
Copy link
Collaborator

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.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Oct 11, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2023
@9inebar
Copy link

9inebar commented Dec 4, 2023

The same error (Mac OS Ventura 13.6.1 (22G313), npm installed, zsh shell):
Screenshot 2023-12-04 at 22 44 55

@alamenai
Copy link

alamenai commented Dec 9, 2023

@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')

@giltroymeren
Copy link

giltroymeren commented Jan 21, 2024

@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.

@Nodenkey
Copy link

Nodenkey commented Jan 21, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E Issue related to end-to-end testing existing workaround OS: windows Reproducible Can be reproduced stale no activity on this issue for a long period topic: installation Issue during installation or downloading Cypress type: bug
Projects
None yet
Development

No branches or pull requests