Version 10: Your configFile is invalid cypress.config.ts
See original GitHub issueCurrent behavior
I can’t get by this screen after the cypress UI pops up, everything seemed fine until the config->.ts step.
Error
Your configFile is invalid: C:\Github\Project\cypress.config.ts
It threw an error when required, check the stack trace below:
[Stack trace](http://localhost:22331/__launchpad/index.html#)
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
at new NodeError (node:internal/errors:371:5)
at throwIfUnsupportedURLProtocol (node:internal/modules/esm/resolve:1033:11)
at defaultResolve (node:internal/modules/esm/resolve:1103:3)
at ESMLoader.resolve (node:internal/modules/esm/loader:530:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:251:18)
at ESMLoader.import (node:internal/modules/esm/loader:332:22)
at importModuleDynamically (node:internal/modules/cjs/loader:1042:29)
at importModuleDynamicallyWrapper (node:internal/vm/module:437:21)
at importModuleDynamically (node:vm:381:46)
at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)
at loadFile (C:\Users\steve\AppData\Local\Cypress\Cache\10.0.0\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\run_require_async_child.js:126:9)
at EventEmitter. (C:\Users\steve\AppData\Local\Cypress\Cache\10.0.0\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\run_require_async_child.js:136:38)
at EventEmitter.emit (node:events:520:28)
at EventEmitter.emit (node:domain:475:12)
at process. (C:\Users\steve\AppData\Local\Cypress\Cache\10.0.0\Cypress\resources\app\node_modules\@packages\server\lib\plugins\util.js:33:22)
at process.emit (node:events:520:28)
import { defineConfig } from 'cypress'
export default defineConfig({
projectId: 'nqoyvw',
viewportWidth: 1480,
viewportHeight: 1260,
video: false,
videosFolder: 'cypress/videos',
screenshotsFolder: 'cypress/screenshots',
pageLoadTimeout: 60000,
requestTimeout: 45000,
responseTimeout: 45000,
experimentalStudio: true,
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
baseUrl: 'https://dev.project.ca',
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
},
})
Debug logs
No response
Cypress Version
10
Package Manager
npm
Operating system
Windows
Other
Node: v16.14.0 tsc: Version 4.0.2
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:16 (7 by maintainers)
Top Results From Across the Web
Invalid configFile (Cypress 10.0) - cannot find module
I've followed the new documentation, however Cypress is stating my file is invalid. "Error: Cannot find module 'cypress'". Here's the config I'm ...
Read more >Configuration - Cypress Documentation
This guide is for Cypress 10 and the new JavaScript configuration file format. If you are on an older version of Cypress that...
Read more >Cypress: Migrating from 9.x to 10.x manually - Medium
You might currently have cypress.json as your config file. This has been now replaced with cypress.config.js or cypress.config.ts .
Read more >Specify Cypress configuration files - BrowserStack
Learn how to specify a Cypress configuration file for your tests run on ... Using the --cypress-config-file CLI parameter ... Cypress v10; Cypress...
Read more >Configurations in Cypress and How to Disable Default ...
What are default configurations provided by Cypress? ... environment variables, node version, the folder path from where it is reading all ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, no, now I’m getting
OK so first of all it looks as if the specific
ERR_UNSUPPORTED_ESM_URL_SCHEME
stack trace I was seeing only appears with Cypress 10.0.0. In 10.0.1 I believe this behaviour may have been slightly altered, and I now see a different error. Specifically, this issue. I will take a look at that issue and see if I can add anything useful there instead. This issue can stay closed.