-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Description
Current behavior
I've just set up cypress on my project, and I get a configuration error when I run cypress open. But the stack trace is empty and the file itself is really basic, here what it look like:

My cypress.config.ts
:
Desired behavior
No response
Test code to reproduce
My cypress.config.ts
:
import {defineConfig} from "cypress";
export default defineConfig({
e2e: {
baseUrl: "http://localhost:5173",
},
});
Cypress Version
Cypress package version: 13.7.1 Cypress binary version: 13.7.1 Electron version: 27.1.3 Bundled Node version: 18.17.1
Node version
v20.9.0
Operating System
macOS Version 14.4 (23E214)
Debug Logs
cypress:cli:cli cli starts with arguments ["/Users/username/.n/bin/node","/Users/username/Documents/Programming/example-trellix/node_modules/.bin/cypress","open"] +0ms
cypress:cli NODE_OPTIONS is not set +0ms
cypress:cli:cli program parsing arguments +1ms
cypress:cli:cli opening Cypress +0ms
cypress:cli parsed cli options {} +81ms
cypress:cli verifying Cypress app +0ms
cypress:cli checking environment variables +1ms
cypress:cli checking if executable exists /Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/MacOS/Cypress +1ms
cypress:cli Binary is executable? : true +0ms
cypress:cli binaryDir is /Users/username/Library/Caches/Cypress/13.7.1/Cypress.app +0ms
cypress:cli Reading binary package.json from: /Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/Resources/app/package.json +0ms
cypress:cli Found binary version 13.7.1 installed in: /Users/username/Library/Caches/Cypress/13.7.1/Cypress.app +3ms
cypress:cli { verified: true } +2ms
cypress:cli is Verified ? true +0ms
cypress:cli opening from options {"project":"/Users/username/Documents/Programming/example-trellix"} +0ms
cypress:cli command line arguments ["--project","/Users/username/Documents/Programming/example-trellix"] +1ms
cypress:cli needs to start own Xvfb? false +0ms
cypress:cli spawning, should retry on display problem? false +0ms
cypress:cli spawn args [ '--no-sandbox', '--', '--project', '/Users/username/Documents/Programming/example-trellix', '--cwd', '/Users/username/Documents/Programming/example-trellix', '--userNodePath', '/Users/username/.n/bin/node', '--userNodeVersion', '20.9.0' ] { detached: false, stdio: [ 'inherit', 'inherit', 'pipe' ] } +1ms
cypress:cli spawning Cypress with executable: /Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/MacOS/Cypress +1ms
cypress:cli piping child STDERR to process STDERR +1ms
cypress:snapshot:info Caching 3472, defining 4299 modules! Using cache +0ms
cypress:snapshot:debug initializing packherd require +0ms
cypress:server:performance-benchmark elapsed time at v8-snapshot-startup-time: 104.318ms +0ms
cypress:server:appdata path: /Users/username/Library/Application Support/Cypress/cy/production/browsers +0ms
cypress:server:cypress starting cypress with argv [ '/Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/MacOS/Cypress', '--no-sandbox', '--', '--project', '/Users/username/Documents/Programming/example-trellix', '--cwd', '/Users/username/Documents/Programming/example-trellix', '--userNodePath', '/Users/username/.n/bin/node', '--userNodeVersion', '20.9.0' ] +0ms
cypress:server:args argv array: [ '/Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/MacOS/Cypress', '--no-sandbox', '--project', '/Users/username/Documents/Programming/example-trellix', '--cwd', '/Users/username/Documents/Programming/example-trellix', '--userNodePath', '/Users/username/.n/bin/node', '--userNodeVersion', '20.9.0' ] +0ms
cypress:server:args parsed argv options { options: { _: [ '/Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/MacOS/Cypress' ], sandbox: false, project: '/Users/username/Documents/Programming/example-trellix', cwd: '/Users/username/Documents/Programming/example-trellix', userNodePath: '/Users/username/.n/bin/node', userNodeVersion: '20.9.0' } } +0ms
cypress:server:args argv parsed: { _: [ '/Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/MacOS/Cypress' ], sandbox: false, project: '/Users/username/Documents/Programming/example-trellix', cwd: '/Users/username/Documents/Programming/example-trellix', userNodePath: '/Users/username/.n/bin/node', userNodeVersion: '20.9.0', invokedFromCli: true } +2ms
cypress:server:util:proxy found proxy environment variables { npm_config_noproxy: '' } +0ms
cypress:server:args options { _: [ '/Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/MacOS/Cypress' ], sandbox: false, project: '/Users/username/Documents/Programming/example-trellix', cwd: '/Users/username/Documents/Programming/example-trellix', userNodePath: '/Users/username/.n/bin/node', userNodeVersion: '20.9.0', invokedFromCli: true, config: {} } +2ms
cypress:server:args argv options: { _: [ '/Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/MacOS/Cypress' ], sandbox: false, project: '/Users/username/Documents/Programming/example-trellix', cwd: '/Users/username/Documents/Programming/example-trellix', userNodePath: '/Users/username/.n/bin/node', userNodeVersion: '20.9.0', invokedFromCli: true, config: {}, projectRoot: '/Users/username/Documents/Programming/example-trellix' } +0ms
cypress:server:cypress from argv [ '/Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/MacOS/Cypress', '--no-sandbox', '--project', '/Users/username/Documents/Programming/example-trellix', '--cwd', '/Users/username/Documents/Programming/example-trellix', '--userNodePath', '/Users/username/.n/bin/node', '--userNodeVersion', '20.9.0' ] got options { _: [ '/Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/MacOS/Cypress' ], sandbox: false, project: '/Users/username/Documents/Programming/example-trellix', cwd: '/Users/username/Documents/Programming/example-trellix', userNodePath: '/Users/username/.n/bin/node', userNodeVersion: '20.9.0', invokedFromCli: true, config: {}, projectRoot: '/Users/username/Documents/Programming/example-trellix' } +5ms
cypress:server:appdata path: /Users/username/Library/Application Support/Cypress/cy/production +37ms
DevTools listening on ws://127.0.0.1:52183/devtools/browser/50bb10ac-1839-4a0c-9a30-b8fe1b9f1e9d
2024-03-22 06:55:19.087 Cypress[42258:3367383] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
cypress:server:cypress starting in mode interactive with options { _: [ '/Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/MacOS/Cypress' ], sandbox: false, project: '/Users/username/Documents/Programming/example-trellix', cwd: '/Users/username/Documents/Programming/example-trellix', userNodePath: '/Users/username/.n/bin/node', userNodeVersion: '20.9.0', invokedFromCli: true, config: {}, projectRoot: '/Users/username/Documents/Programming/example-trellix' } +77ms
cypress:server:cypress running Electron currently +0ms
cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudLatestRunUpdateSpecData +0ms
cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudProjectBySlug +0ms
cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudProjectsBySlugs +0ms
...
cypress:graphql:nexusDeferIfNotLoadedPlugin Racing execution for CurrentProject.cloudProject +0ms
cypress:graphql:nexusDeferIfNotLoadedPlugin Racing Query.cloudViewer resolved immediately +0ms
cypress:lifecycle:ProjectConfigManager catch { name: 'Error', message: 'Your \x1B[33mconfigFile\x1B[39m is invalid: \x1B[94m/Users/username/Documents/Programming/example-trellix/cypress.config.ts\x1B[39m\n' + '\n' + 'It threw an error when required, check the stack trace below:', stack: '{}', type: 'CONFIG_FILE_REQUIRE_ERROR', details: '{}', isCypressErr: true, messageMarkdown: 'Your `configFile` is invalid: `/Users/username/Documents/Programming/example-trellix/cypress.config.ts`\n' + '\n' + 'It threw an error when required, check the stack trace below:', originalError: { name: 'Error', message: '', stack: '{}' } } +4ms
cypress:lifecycle:ProjectConfigManager catch { name: 'Error', message: 'Your \x1B[33mconfigFile\x1B[39m is invalid: \x1B[94m/Users/username/Documents/Programming/example-trellix/cypress.config.ts\x1B[39m\n' + '\n' + 'It threw an error when required, check the stack trace below:', stack: '{}', type: 'CONFIG_FILE_REQUIRE_ERROR', details: '{}', isCypressErr: true, messageMarkdown: 'Your `configFile` is invalid: `/Users/username/Documents/Programming/example-trellix/cypress.config.ts`\n' + '\n' + 'It threw an error when required, check the stack trace below:', originalError: { name: 'Error', message: '', stack: '{}' } } +0ms
cypress:graphql:nexusDeferIfNotLoadedPlugin Racing CurrentProject.cloudProject resolved immediately +0ms
cypress:config:browser validating configuration {} +5ms
cypress:config:browser validating configuration {} +0ms
cypress:server:saved_state making saved state from /Users/username/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/Resources/app/packages/server +13ms
cypress:server:saved_state missing project path, looking for project here +0ms
cypress:server:saved_state state path for global mode +1ms
cypress:server:appdata path: /Users/username/Library/Application Support/Cypress/cy/production/projects/__global__/state.json +14ms
cypress:server:saved_state full state path /Users/username/Library/Application Support/Cypress/cy/production/projects/__global__/state.json +0ms
cypress:server:interactive clearing DataContext prior to quit +0ms
Other
Downgrading to v18.17.0 via n 18.17.0
and re-running gave me more details:
06:57:12|➜ example-trellix git:(main) ✗ npx cypress open
DevTools listening on ws://127.0.0.1:52265/devtools/browser/8a4d4eb6-db1d-45af-9d7a-21cf6b755635
2024-03-22 06:57:18.605 Cypress[45621:3374276] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
(node:45656) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:45656) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time.
/Users/avallete/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:311
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.
at createTSError (/Users/avallete/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:311:16)
at reportTSError (/Users/avallete/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:314:23)
at /Users/avallete/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:686:17
at Object.compile (/Users/avallete/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:743:35)
at Module.m._compile (/Users/avallete/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:856:36)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Object.require.extensions.<computed> [as .js] (/Users/avallete/Library/Caches/Cypress/13.7.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:859:16)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Function.Module._load (node:internal/modules/cjs/loader:960:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29) {
diagnosticCodes: [ 5095 ]
}
Then adding "module": "Preserve"
in my project tsconfig.json file. Then, bumping my version of node back to 20 worked fine.
So it seems the issue came from the tsconfig.json file. But somehow the error fail to indicate that.
Dobby89, rozek, boylec, dvnrsn, danilobjr and 1 more