question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot record Cypress runs, cannot open Runs tab of Test Runner

See original GitHub issue

Current behavior:

I try to record my Cypress run and see the message:

Opening Cypress...
Warning: We encountered an error talking to our servers.

This run will not be recorded.

This error will not alter the exit code.

RequestError: Error: Invalid URI "/builds"

The tests continue to run fine, but they aren’t recorded and then available in my dashboard. I am running yarn cypress run --record --key xxx and have verified the key is correct.

If I try and access the ‘Runs’ tab of the Test Runner, the Test Runner crashes and closes and I see the stack trace

TypeError: Parameter "url" must be a string, not undefined
    at Url.parse (url.js:102:11)
    at Object.urlParse [as parse] (url.js:96:5)
    at Object.ensureUrl (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/util/connect.js:38:17)
    at EventEmitter.handleEvent (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/gui/events.js:222:24)
    at apply (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/lodash/lodash.js:499:17)
    at EventEmitter.wrapper (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/lodash/lodash.js:5356:16)
    at emitThree (events.js:135:13)
    at EventEmitter.emit (events.js:216:7)
    at WebContents.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/electron.asar/browser/api/web-contents.js:266:13)
    at emitTwo (events.js:125:13)
    at WebContents.emit (events.js:213:7)

Interesting to note is that if I install Cypress globally and run it this way (cypress run --record --key xxx), there is no issue. Using the globally installed version is how I managed to set my project up on the dashboard in the first place (as using local Cypress crashes when I open the Runs tab). I also have Cypress in 2 other projects (same version 2.1.0) and have been recording runs in the exact same way with no issue.

I tried removing node_modules and yarn.lock and installing from scratch but the problem persists.

Desired behavior:

I am able to run yarn cypress run --record --key xxx and see my recorded run in the dashboard

Versions

Cypress 2.1.0 Mac High Sierra Electron 59.0.3071.115

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
brian-manncommented, Apr 20, 2018

@chinchiheather you don’t need to set it at all. Just remove it and Cypress will set it to what it needs to be set to.

I’ll open an issue stating what we can do in the future to prevent this.

0reactions
chinchiheathercommented, Apr 20, 2018

Ahh yeah I was experimenting with using environment variables to set some custom configuration. I must have called one CYPRESS_ENV.

Set it back to ‘production’ and all is good now, thanks so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Cypress Documentation
Open Cypress via cypress open · Go to Developer Tools -> View App Data · This will take you to the directory in...
Read more >
Runs - Cypress Documentation
Recorded runs capture the results from your test runs. If you haven't set up your project to record read here. Run Details On...
Read more >
Error Messages | Cypress Documentation
We found an error preparing your test file. This message means that Cypress encountered an error when compiling and/or bundling your test file....
Read more >
Cypress Cloud
Tests are recorded when cypress run is called with the --record flag while supplying the record --key . This means your test run...
Read more >
Projects - Cypress Documentation
Click on the Runs tab of your project within Cypress. Click Connect to Cypress Cloud. You will need to log in to record...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found