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

Cypress no longer supports cypress.json #370

Closed
Ross-mc opened this issue Jul 12, 2022 · 5 comments
Closed

Cypress no longer supports cypress.json #370

Ross-mc opened this issue Jul 12, 2022 · 5 comments

Comments

@Ross-mc
Copy link

Ross-mc commented Jul 12, 2022

As of Cypress 10, cypress.json is no longer supported (https://docs.cypress.io/guides/references/configuration).

Browserstack-cypress-cli requires a json file in cypress_config_file and throws an invalid JSON parse error when I reference cypress.config.ts (which is to be expected as its not JSON).

(node:10945) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
[12/07/2022, 12:05:20] - error:  
{
  message: 'Unexpected token i in JSON at position 0',
  stack: 'SyntaxError: Unexpected token i in JSON at position 0\n' +
    '    at JSON.parse (<anonymous>)\n' +
    '    at Object.exports.getCypressJSON (/Users/ross/.nvm/versions/node/v14.18.1/lib/node_modules/browserstack-cypress-cli/bin/helpers/utils.js:1082:24)\n' +
    '    at Object.exports.setProjectId (/Users/ross/.nvm/versions/node/v14.18.1/lib/node_modules/browserstack-cypress-cli/bin/helpers/utils.js:363:28)\n' +
    '    at Object.exports.setRecordCaps (/Users/ross/.nvm/versions/node/v14.18.1/lib/node_modules/browserstack-cypress-cli/bin/helpers/utils.js:371:45)\n' +
    '    at /Users/ross/.nvm/versions/node/v14.18.1/lib/node_modules/browserstack-cypress-cli/bin/commands/runs.js:98:11\n' +
    '    at processTicksAndRejections (internal/process/task_queues.js:95:5)'
}```



Will support for cypress.config.ts be added?
@dspaeth-breuni
Copy link

more or less a duplicate of #342 ?

@Ross-mc
Copy link
Author

Ross-mc commented Jul 14, 2022

more or less a duplicate of #342 ?

There is some duplication, but I am highlighting a specific issue about Cypress config and curious if there is a workaround with the current version of browserstack, I haven't been able to find anything so far.

@Aditya-GBS
Copy link

BrowserStack does not support Cypress 10 as of now.
The implementation of new folder structure of Cypress 10 might take some more time
Meanwhile, Cypress.json is still supported so you may use it until then

@rrsai
Copy link

rrsai commented Aug 4, 2022

If you're like me, you wanted to use both, and so as a workaround, point the browserstack.json config file path at a simple config file, e.g.

./cypress/blank.json and use that config file for browserstack with overrides for environment variables in your local dev environment!

@pranavj1001
Copy link
Member

Closing this issue as BrowserStack supports Cypress 10. Make sure you update to the latest CLI. Feel free to open another issue if you're still facing any problems.

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

5 participants