Title: Authentication with Environment Variables returning error · Issue #879 · browserstack/browserstack-cypress-cli · GitHub
Open Graph Title: Authentication with Environment Variables returning error · Issue #879 · browserstack/browserstack-cypress-cli
X Title: Authentication with Environment Variables returning error · Issue #879 · browserstack/browserstack-cypress-cli
Description: I am attempting to use Environment Variables, inside of my .env file, to load my BROWSERSTACK_USERNAME & BROWSERSTACK_ACCESS_KEY credentials. If I add my Browserstack credentials into the auth object within the browserstack.json file, I ...
Open Graph Description: I am attempting to use Environment Variables, inside of my .env file, to load my BROWSERSTACK_USERNAME & BROWSERSTACK_ACCESS_KEY credentials. If I add my Browserstack credentials into the auth obje...
X Description: I am attempting to use Environment Variables, inside of my .env file, to load my BROWSERSTACK_USERNAME & BROWSERSTACK_ACCESS_KEY credentials. If I add my Browserstack credentials into the auth ...
Opengraph URL: https://github.com/browserstack/browserstack-cypress-cli/issues/879
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Authentication with Environment Variables returning error","articleBody":"I am attempting to use Environment Variables, inside of my .env file, to load my BROWSERSTACK_USERNAME & BROWSERSTACK_ACCESS_KEY credentials. \r\n\r\nIf I add my Browserstack credentials into the auth object within the browserstack.json file, I have no issues authenticating and running my Cypress tests. But if I move these values in my BROWSERSTACK_USERNAME & BROWSERSTACK_ACCESS_KEY variables inside of my .env file and run the same command, I am getting this error: \r\n\r\n```\r\n{\r\n message: \"Cannot read properties of undefined (reading 'username')\",\r\n stack: \"TypeError: Cannot read properties of undefined (reading 'username')\\n\" +\r\n ' at /Users/billpond/code/comparecredit/packages/cc-www/node_modules/browserstack-cypress-cli/bin/helpers/getInitialDetails.js:12:33\\n' +\r\n ' at new Promise (\u003canonymous>)\\n' +\r\n ' at exports.getInitialDetails (/Users/billpond/code/comparecredit/packages/cc-www/node_modules/browserstack-cypress-cli/bin/helpers/getInitialDetails.js:8:10)\\n' +\r\n ' at /Users/billpond/code/comparecredit/packages/cc-www/node_modules/browserstack-cypress-cli/bin/commands/runs.js:87:86\\n' +\r\n ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)'\r\n}\r\n```\r\n\r\nWhen debugging, I have logged out my \"process.env\" value in the setUsername function in the util.js file. When I did this, I do not see any of my .env values within that process. It seems like the only values included were the typical node values inside of the process: https://pastebin.com/syj8rRAN\r\n\r\nI have tried both node versions v18.18.2 and v20.17.0 and ran into the same issue. To run this code, I have been running a command in my package.json that is set to `\"e2e:browserstack\": \"browserstack-cypress run\"`\r\n\r\nI am trying to follow the documentation mentioned here: https://www.browserstack.com/docs/automate/cypress/authentication\r\n\r\nThank you so much in advance! \r\n","author":{"url":"https://github.com/dudeOFprosper","@type":"Person","name":"dudeOFprosper"},"datePublished":"2024-10-01T19:07:42Z","url":"https://github.com/browserstack/browserstack-cypress-cli/issues/879"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f55a044a-f31b-21cd-2425-326b6a961ea3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C2C:3488ED:C46423:1129C05:6B0439AF |
| html-safe-nonce | f05c4d01e5e45696c256921624c93f9695d2a6d4d234cdfbf978fce9ccdb9dd0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzJDOjM0ODhFRDpDNDY0MjM6MTEyOUMwNTo2QjA0MzlBRiIsInZpc2l0b3JfaWQiOiI2NjEwMzY1NTUyNjgwNzc4MTU5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fe4cbee6e6cf53647fef9d591878fd4b1d33b7db7a6b6b35ec778ca4085b4938 |
| hovercard-subject-tag | issue:2559989436 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/browserstack/browserstack-cypress-cli/879/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7f11dc4c95f42844f7d9b3852b7f62487e52c0d900b3eb8a43809ffa52239b45/browserstack/browserstack-cypress-cli/issues/879 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7f11dc4c95f42844f7d9b3852b7f62487e52c0d900b3eb8a43809ffa52239b45/browserstack/browserstack-cypress-cli/issues/879 |
| og:image:alt | I am attempting to use Environment Variables, inside of my .env file, to load my BROWSERSTACK_USERNAME & BROWSERSTACK_ACCESS_KEY credentials. If I add my Browserstack credentials into the auth obje... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dudeOFprosper |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64 |
| turbo-cache-control | no-preview |
| go-import | github.com/browserstack/browserstack-cypress-cli git https://github.com/browserstack/browserstack-cypress-cli.git |
| octolytics-dimension-user_id | 1119453 |
| octolytics-dimension-user_login | browserstack |
| octolytics-dimension-repository_id | 242935045 |
| octolytics-dimension-repository_nwo | browserstack/browserstack-cypress-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 242935045 |
| octolytics-dimension-repository_network_root_nwo | browserstack/browserstack-cypress-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 06dc448a76fe4751ac1db26524aefa3aa3e889a8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width