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

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

Closed
chinchiheather opened this issue Apr 19, 2018 · 12 comments
Closed

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

chinchiheather opened this issue Apr 19, 2018 · 12 comments

Comments

@chinchiheather
Copy link
Contributor

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

@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label Apr 19, 2018
@jennifer-shehane
Copy link
Member

Did you happen to edit your cypress.json, like edit the projectId in there?

If not, this is a pretty strange error, is there any info you can give above what you did before it stopped working?

@brian-mann
Copy link
Member

Hmm... I can only think of two ways this is happening..

  1. you've modified the source code in Cypress. Seems unlikely since you did a fresh install. However yarn does cache this locally so if you edited the local cache of the node_module its possible but unlikely.
  2. You're setting NODE_ENV=... or CYPRESS_ENV=... to something that is overriding how Cypress constructs the API URL. Your comment here: yarn cypress run --record --key xxx does not seem like a valid command. Can you look to see how exactly you are running Cypress? My guess is that that is where the problem is.

@chinchiheather
Copy link
Contributor Author

I double checked the projectId in my cypress.json file and it matches the one shown in my dashboard settings. Here is my cypress.json:

{
  "projectId": "trxgrd",
  "baseUrl": "http://localhost:2427",
  "testFiles": "**/*.e2e-spec.js",
  "requestTimeout": 15000,
  "videoUploadOnPasses": false
}

I didn't do anything special to experience the problem. This is a new project I am just setting up and wanted to add Cypress into.

I tried running yarn cache clean before doing an install this time (after deleting the node_modules) and the problem persists. I tried making some changes to the source code after I experienced the problem the first time, just making a couple changes to experiment with things. But have since removed and reinstalled several times. And I didn't make any changes before I experienced the issue.

I am running that command for the recorded run, here is a screenshot of the run (I have blacked out the key):
Screenshot
I also have an npm script I use to run it which has the same error. I can run it successfully both ways in the 2 other projects I have set it up in.

I am not setting CYPRESS_ENV anywhere. I only set NODE_ENV in a setup file for running unit tests which is separate to my Cypress tests.

@brian-mann
Copy link
Member

Hmm edit the source code here: https://github.com/cypress-io/cypress/blob/master/packages/server/lib/modes/record.coffee#L80

And add console.log(err.stack) on that line. What's happening is there is a generic catch handler swallowing and masking the true error. Per what you posted before it seems there is a real problem somewhere.

Now also edit this file here: https://github.com/cypress-io/cypress/blob/master/packages/server/lib/konfig.coffee#L16

And add console.log(previousNodeEnv, previousNodeEnvExisted, config) to that line.

Run and paste the output. You don't have to show your key or command, just the output from the console's.

@chinchiheather
Copy link
Contributor Author

Okay so the log from konfig.coffee:

undefined false { cdn_url: 'https://cdn.cypress.io',
  desktop_url: 'https://download.cypress.io/desktop',
  desktop_manifest_url: 'https://download.cypress.io/desktop.json',
  chromium_url: 'https://download.cypress.io/chromium',
  chromium_manifest_url: 'https://download.cypress.io/chromium.json' }

And the stack trace when adding the log to record.coffee:

RequestError: Error: Invalid URI "/builds"
    at new RequestError (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/request-promise-core/lib/errors.js:14:15)
    at Request.plumbing.callback (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/request-promise-core/lib/plumbing.js:87:29)
    at Request.RP$callback [as _callback] (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/request/request.js:186:22)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at Request.init (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/request/request.js:274:17)
    at Request.RP$initInterceptor [as init] (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/request-promise-core/configure/request2.js:45:29)
    at new Request (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/request/request.js:128:8)
    at request (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/request/index.js:54:10)
    at Function.post (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/request/index.js:62:12)
    at /Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/api.js:37:27
    at Function.post (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/request/index.js:101:12)
    at Object.createRun (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/api.js:123:17)
    at /Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/modes/record.js:85:20
    at tryCatcher (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:507:35)
    at Promise._settlePromise (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:636:18)
    at PromiseArray._resolve (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:125:19)
    at PromiseArray._promiseFulfilled (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:143:14)
    at PromiseArray._iterate (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:113:31)
    at PromiseArray.init [as _init] (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:77:10)
    at Promise._settlePromise (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:564:21)
    at Promise._settlePromise0 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:636:18)
    at PromiseArray._resolve (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:125:19)
    at PromiseArray._promiseFulfilled (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:143:14)
    at Promise._settlePromise (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:572:26)
    at Promise._settlePromise0 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:636:18)
    at Promise._resolveCallback (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:431:57)
    at Promise._settlePromiseFromHandler (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:522:17)
    at Promise._settlePromise (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:636:18)
    at Promise._resolveCallback (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:431:57)
    at Promise._settlePromiseFromHandler (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:522:17)
    at Promise._settlePromise (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:636:18)
    at Promise._resolveCallback (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:431:57)
    at Promise._settlePromiseFromHandler (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:522:17)
    at Promise._settlePromise (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:636:18)
    at MappingPromiseArray.PromiseArray._resolve (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:125:19)
    at MappingPromiseArray._promiseFulfilled (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/map.js:101:18)
    at MappingPromiseArray.PromiseArray._iterate (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:113:31)
    at MappingPromiseArray.init (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:77:10)
    at Promise._settlePromise (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:564:21)
    at Promise._settlePromise0 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:636:18)
    at MappingPromiseArray.PromiseArray._resolve (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:125:19)
    at MappingPromiseArray._filter (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/map.js:127:10)
    at MappingPromiseArray._promiseFulfilled (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/map.js:99:18)
    at MappingPromiseArray.PromiseArray._iterate (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:113:31)
    at MappingPromiseArray.init (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:77:10)
    at Promise._settlePromise (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:564:21)
    at Promise._settlePromise0 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:636:18)
    at MappingPromiseArray.PromiseArray._resolve (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:125:19)
    at MappingPromiseArray._filter (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/map.js:127:10)
    at MappingPromiseArray._promiseFulfilled (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/map.js:99:18)
    at MappingPromiseArray.PromiseArray._iterate (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:113:31)
    at MappingPromiseArray.init (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:77:10)
    at Promise._settlePromise (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:564:21)
    at Promise._settlePromise0 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:636:18)
    at /Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/nodeback.js:42:21
    at f (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/once/once.js:25:25)
    at Glob.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/glob/glob.js:151:7)
    at emitOne (events.js:115:13)
    at Glob.emit (events.js:210:7)
    at Glob._finish (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/glob/glob.js:197:8)
    at done (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/glob/glob.js:182:14)
    at Glob._processGlobStar2 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/glob/glob.js:637:12)
    at /Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/glob/glob.js:626:10
    at RES (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/inflight/inflight.js:31:16)
    at f (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/once/once.js:25:25)
    at lstatcb_ (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/glob/glob.js:519:7)
    at RES (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/inflight/inflight.js:31:16)
    at f (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/once/once.js:25:25)
    at /Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:153:5)

@brian-mann
Copy link
Member

You are missing api_url from the config which is why it's dieing later when trying to interact with the API. That's why the URI is invalid.

Go into this file here: https://github.com/cypress-io/cypress/blob/master/packages/server/lib/environment.coffee#L32

And replace that line with these three lines...

console.log(process.env["CYPRESS_ENV"], pkg)
env = (base = process.env)["CYPRESS_ENV"] || (base["CYPRESS_ENV"] = (ref = pkg.env) != null ? ref : "development");
console.log(env)

@chinchiheather
Copy link
Contributor Author

Okay that gives:

live { name: 'cypress',
  productName: 'Cypress',
  description: 'Cypress.io end to end testing tool',
  version: '2.1.0',
  main: 'index.js',
  scripts: {},
  env: 'production' }
live
undefined false undefined

And then an error about the api_url:

Cannot read property 'api_url' of undefined
TypeError: Cannot read property 'api_url' of undefined
    at /Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/konfig.js:21:21
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/util/routes.js:11:13)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/util/routes.js:66:4)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/util/routes.js:68:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/coffee/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/api.js:20:12)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/api.js:296:4)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/api.js:298:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/coffee/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/user.js:4:9)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/user.js:52:4)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/user.js:54:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/coffee/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/modes/headless.js:26:10)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/modes/headless.js:537:4)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/modes/headless.js:539:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/coffee/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/modes/record.js:12:14)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/modes/record.js:280:4)
    at Object.<anonymous> (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/modes/record.js:282:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/coffee/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at module.exports (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/modes/index.js:5:16)
    at /Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/cypress.js:43:38
    at tryCatcher (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Function.Promise.attempt.Promise.try (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/method.js:39:29)
    at Object.runElectron (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/cypress.js:40:28)
    at Object.startInMode (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/cypress.js:165:23)
    at /Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/lib/cypress.js:120:24
    at tryCatcher (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:636:18)
    at Promise._settlePromise (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:580:21)
    at Promise._settlePromise0 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:636:18)
    at PromiseArray._resolve (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:125:19)
    at PromiseArray._promiseFulfilled (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise_array.js:143:14)
    at Promise._settlePromise (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:572:26)
    at Promise._settlePromise0 (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:636:18)
    at /Users/heatherroberts/Desktop/3P Projects/school-usage-reports/node_modules/cypress/dist/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/nodeback.js:42:21
    at FSReqWrap.oncomplete (fs.js:135:15)

@brian-mann
Copy link
Member

That's the problem. You are setting process.env["CYPRESS_ENV"] somewhere to the value of live.

This could be somewhere inside your bash profile... try searching around and let me know what you find. It's expected that this value gets set to production. live is definitely not coming anywhere inside of Cypress code.

@bahmutov
Copy link
Contributor

bahmutov commented Apr 20, 2018 via email

@brian-mann
Copy link
Member

Yeah we could make sure its oneOf a valid value, and if not, dont use the env var, and instead let it hit pkg.env or default development.

@chinchiheather
Copy link
Contributor Author

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!

@brian-mann
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants