Cypress: cypress-cloud configuration can't load due to typscript

398 Views Asked by At

I need to run cypress tests locally before figuring them out in Jenkins. The config file I'm wanting to use works properly when I run npm run cypress open --config-file=cypress/config/cypress.test.config.ts --browser chrome --e2e but is not working property when I switch to use the cypress-cloud plugin to make it compatible with the sorry-cypress dashboard (instead of cy2).

Command I've been running: npx cypress-cloud --cloud-config-file cypress/config/cypress.test.config.ts --browser chrome --ci-build-id hello-cypress-cloud02 --spec cypress/e2e/smoke/*

Here's the error I've been receiving in response:

Failed to load config file, falling back to the default config. Attempted locations: [
  'file:///Users/kate/Repos/loon/cypress/config/cypress.test.config.ts'
]

Using debug mode, found out this - currents:config failed loading config file from: TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/kate/Repos/loon/cypress/config/cypress.test.config.ts

I can't find anything online about how to make ts work here, it was working previously with cy2... I can't change the files to js at this point, we use them in a lot of places.

2

There are 2 best solutions below

1
Kate E On BEST ANSWER

Currents and cypress-cloud do not support ts. config files.

0
Shahar On

I am running inside a docker container, you can see according to the logs which files it supports:

WARNING  Failed to load config file, falling back to the default config. Attempted locations: [
my_cypress_container_name |   'file:///app/currents.config.js',
my_cypress_container_name |   'file:///app/currents.config.cjs',
my_cypress_container_name |   'file:///app/currents.config.mjs'
my_cypress_container_name | ]

So yes, currents or sorry cypress or cypress-cloud don't support