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

TypeScript 5 support: "allowImportingTsExtensions": true causing Cypress configuration error #26148

Closed
michaelhays opened this issue Mar 17, 2023 · 23 comments
Assignees

Comments

@michaelhays
Copy link
Contributor

michaelhays commented Mar 17, 2023

Current behavior

TypeScript 5.0 has an option for allowImportingTsExtensions, which allows writing imports with a .ts or .tsx extension.

Currently, this breaks Cypress (both npx cypress run and npx cypress open) with the following error:

TSError: ⨯ Unable to compile TypeScript:
error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.

This is failing even though noEmit is set to true.

Screenshot

image

Desired behavior

Ideally, this wouldn't break Cypress.

Test code to reproduce

I created a repo at https://github.com/michaelhays/cypress-ts-import which demonstrates the bug.

Cypress Version

12.8.1

Node version

18.12.1

Operating System

Linux Mint 21.3

Debug Logs

Expand
cypress:cli:cli cli starts with arguments ["/home/michael/.volta/tools/image/node/18.12.1/bin/node","/home/michael/projects/cypress-ts-import/node_modules/.bin/cypress","run"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli:cli program parsing arguments +1ms
  cypress:cli:cli running Cypress with args [ Command { _events: [Object: null prototype] { 'option:auto-cancel-after-failures': [Function (anonymous)], 'option:browser': [Function (anonymous)], 'option:ci-build-id': [Function (anonymous)], 'option:component': [Function (anonymous)], 'option:config': [Function (anonymous)], 'option:config-file': [Function (anonymous)], 'option:e2e': [Function (anonymous)], 'option:env': [Function (anonymous)], 'option:group': [Function (anonymous)], 'option:key': [Function (anonymous)], 'option:headed': [Function (anonymous)], 'option:headless': [Function (anonymous)], 'option:no-exit': [Function (anonymous)], 'option:parallel': [Function (anonymous)], 'option:port': [Function (anonymous)], 'option:project': [Function (anonymous)], 'option:quiet': [Function (anonymous)], 'option:record': [Function (anonymous)], 'option:reporter': [Function (anonymous)], 'option:reporter-options': [Function (anonymous)], 'option:spec': [Function (anonymous)], 'option:tag': [Function (anonymous)], 'option:dev': [Function (anonymous)] }, _eventsCount: 23, _maxListeners: undefined, commands: [], options: [ [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option] ], parent: Command { _events: [Object: null prototype], _eventsCount: 1, _maxListeners: undefined, commands: [Array], options: [Array], parent: null, _allowUnknownOption: false, _args: [], rawArgs: [Array], _scriptPath: '/home/michael/projects/cypress-ts-import/node_modules/.bin/cypress', _name: 'cypress', _optionValues: {}, _storeOptionsAsProperties: true, _passCommandToAction: true, _actionResults: [], _actionHandler: null, _executableHandler: false, _executableFile: null, _defaultCommandName: null, _exitCallback: null, _aliases: [], _hidden: false, _helpFlags: '-h, --help', _helpDescription: 'display help for command', _helpShortFlag: '-h', _helpLongFlag: '--help', _hasImplicitHelpCommand: undefined, _helpCommandName: 'help', _helpCommandnameAndArgs: 'help [command]', _helpCommandDescription: 'display help for command', _usage: '<command> [options]', args: [Array], [Symbol(kCapture)]: false }, _allowUnknownOption: false, _args: [], rawArgs: null, _scriptPath: null, _name: 'run', _optionValues: {}, _storeOptionsAsProperties: true, _passCommandToAction: true, _actionResults: [], _actionHandler: [Function: listener], _executableHandler: false, _executableFile: null, _defaultCommandName: null, _exitCallback: null, _aliases: [], _hidden: false, _helpFlags: '-h, --help', _helpDescription: 'display help for command', _helpShortFlag: '-h', _helpLongFlag: '--help', _hasImplicitHelpCommand: 0, _helpCommandName: 'help', _helpCommandnameAndArgs: 'help [command]', _helpCommandDescription: 'display help for command', _usage: '[options]', _description: 'Runs Cypress tests from the CLI without the GUI', _argsDescription: undefined, exit: true, args: [], [Symbol(kCapture)]: false } ] +0ms
  cypress:cli:cli variable-length opts parsed { args: [ '/home/michael/.volta/tools/image/node/18.12.1/bin/node', '/home/michael/projects/cypress-ts-import/node_modules/.bin/cypress', 'run' ], opts: Command { _events: [Object: null prototype] { 'option:auto-cancel-after-failures': [Function (anonymous)], 'option:browser': [Function (anonymous)], 'option:ci-build-id': [Function (anonymous)], 'option:component': [Function (anonymous)], 'option:config': [Function (anonymous)], 'option:config-file': [Function (anonymous)], 'option:e2e': [Function (anonymous)], 'option:env': [Function (anonymous)], 'option:group': [Function (anonymous)], 'option:key': [Function (anonymous)], 'option:headed': [Function (anonymous)], 'option:headless': [Function (anonymous)], 'option:no-exit': [Function (anonymous)], 'option:parallel': [Function (anonymous)], 'option:port': [Function (anonymous)], 'option:project': [Function (anonymous)], 'option:quiet': [Function (anonymous)], 'option:record': [Function (anonymous)], 'option:reporter': [Function (anonymous)], 'option:reporter-options': [Function (anonymous)], 'option:spec': [Function (anonymous)], 'option:tag': [Function (anonymous)], 'option:dev': [Function (anonymous)] }, _eventsCount: 23, _maxListeners: undefined, commands: [], options: [ [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option] ], parent: Command { _events: [Object: null prototype], _eventsCount: 1, _maxListeners: undefined, commands: [Array], options: [Array], parent: null, _allowUnknownOption: false, _args: [], rawArgs: [Array], _scriptPath: '/home/michael/projects/cypress-ts-import/node_modules/.bin/cypress', _name: 'cypress', _optionValues: {}, _storeOptionsAsProperties: true, _passCommandToAction: true, _actionResults: [], _actionHandler: null, _executableHandler: false, _executableFile: null, _defaultCommandName: null, _exitCallback: null, _aliases: [], _hidden: false, _helpFlags: '-h, --help', _helpDescription: 'display help for command', _helpShortFlag: '-h', _helpLongFlag: '--help', _hasImplicitHelpCommand: undefined, _helpCommandName: 'help', _helpCommandnameAndArgs: 'help [command]', _helpCommandDescription: 'display help for command', _usage: '<command> [options]', args: [Array], [Symbol(kCapture)]: false }, _allowUnknownOption: false, _args: [], rawArgs: null, _scriptPath: null, _name: 'run', _optionValues: {}, _storeOptionsAsProperties: true, _passCommandToAction: true, _actionResults: [], _actionHandler: [Function: listener], _executableHandler: false, _executableFile: null, _defaultCommandName: null, _exitCallback: null, _aliases: [], _hidden: false, _helpFlags: '-h, --help', _helpDescription: 'display help for command', _helpShortFlag: '-h', _helpLongFlag: '--help', _hasImplicitHelpCommand: 0, _helpCommandName: 'help', _helpCommandnameAndArgs: 'help [command]', _helpCommandDescription: 'display help for command', _usage: '[options]', _description: 'Runs Cypress tests from the CLI without the GUI', _argsDescription: undefined, exit: true, args: [], [Symbol(kCapture)]: false } } +59ms
  cypress:cli parsed cli options {} +61ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli checking environment variables +0ms
  cypress:cli checking if executable exists /home/michael/.cache/Cypress/12.8.1/Cypress/Cypress +2ms
  cypress:cli Binary is executable? : true +1ms
  cypress:cli binaryDir is  /home/michael/.cache/Cypress/12.8.1/Cypress +0ms
  cypress:cli Reading binary package.json from: /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/package.json +0ms
  cypress:cli Found binary version 12.8.1 installed in: /home/michael/.cache/Cypress/12.8.1/Cypress +2ms
  cypress:cli { verified: true } +3ms
  cypress:cli is Verified ? true +1ms
  cypress:cli:run processing run options { key: null, spec: null, reporter: null, reporterOptions: null, project: '/home/michael/projects/cypress-ts-import' } +0ms
  cypress:cli:run --key is not set, looking up environment variable CYPRESS_RECORD_KEY +0ms
  cypress:cli:run run to spawn.start args ["--run-project","/home/michael/projects/cypress-ts-import"] +1ms
  cypress:cli DISPLAY environment variable is set to :0 on Linux
  cypress:cli Assuming this DISPLAY points at working X11 server,
  cypress:cli Cypress will not spawn own Xvfb
  cypress:cli 
  cypress:cli NOTE: if the X11 server is NOT working, Cypress will exit without explanation,
  cypress:cli   see https://github.com/cypress-io/cypress/issues/4034
  cypress:cli Solution: Unset the DISPLAY variable and try again:
  cypress:cli   DISPLAY= npx cypress run ... +0ms
  cypress:cli needs to start own Xvfb? false +0ms
  cypress:cli spawning, should retry on display problem? true +0ms
  cypress:cli passing DISPLAY :0 +5ms
  cypress:cli spawn args [ '--no-sandbox', '--', '--run-project', '/home/michael/projects/cypress-ts-import', '--cwd', '/home/michael/projects/cypress-ts-import', '--userNodePath', '/home/michael/.volta/tools/image/node/18.12.1/bin/node', '--userNodeVersion', '18.12.1' ] { detached: false, stdio: [ 'inherit', 'inherit', 'pipe' ] } +0ms
  cypress:cli spawning Cypress with executable: /home/michael/.cache/Cypress/12.8.1/Cypress/Cypress +0ms
  cypress:cli piping child STDERR to process STDERR +6ms
  cypress:snapshot:info Caching 3498, defining 4411 modules! Using cache +0ms
  cypress:snapshot:debug initializing packherd require +0ms
  cypress:server:appdata path: /home/michael/.config/Cypress/cy/production/browsers +0ms
  cypress:server:cypress starting cypress with argv [ '/home/michael/.cache/Cypress/12.8.1/Cypress/Cypress', '--no-sandbox', '--', '--run-project', '/home/michael/projects/cypress-ts-import', '--cwd', '/home/michael/projects/cypress-ts-import', '--userNodePath', '/home/michael/.volta/tools/image/node/18.12.1/bin/node', '--userNodeVersion', '18.12.1' ] +0ms
  cypress:server:args argv array: [ '/home/michael/.cache/Cypress/12.8.1/Cypress/Cypress', '--no-sandbox', '--run-project', '/home/michael/projects/cypress-ts-import', '--cwd', '/home/michael/projects/cypress-ts-import', '--userNodePath', '/home/michael/.volta/tools/image/node/18.12.1/bin/node', '--userNodeVersion', '18.12.1' ] +0ms
  cypress:server:args parsed argv options { options: { _: [ '/home/michael/.cache/Cypress/12.8.1/Cypress/Cypress' ], sandbox: false, 'run-project': '/home/michael/projects/cypress-ts-import', runProject: '/home/michael/projects/cypress-ts-import', cwd: '/home/michael/projects/cypress-ts-import', userNodePath: '/home/michael/.volta/tools/image/node/18.12.1/bin/node', userNodeVersion: '18.12.1' } } +1ms
  cypress:server:args argv parsed: { _: [ '/home/michael/.cache/Cypress/12.8.1/Cypress/Cypress' ], sandbox: false, runProject: '/home/michael/projects/cypress-ts-import', cwd: '/home/michael/projects/cypress-ts-import', userNodePath: '/home/michael/.volta/tools/image/node/18.12.1/bin/node', userNodeVersion: '18.12.1', invokedFromCli: true } +3ms
  cypress:server:util:proxy found proxy environment variables { npm_config_noproxy: '' } +0ms
  cypress:server:args options { _: [ '/home/michael/.cache/Cypress/12.8.1/Cypress/Cypress' ], sandbox: false, runProject: '/home/michael/projects/cypress-ts-import', cwd: '/home/michael/projects/cypress-ts-import', userNodePath: '/home/michael/.volta/tools/image/node/18.12.1/bin/node', userNodeVersion: '18.12.1', invokedFromCli: true, config: {} } +3ms
  cypress:server:args argv options: { _: [ '/home/michael/.cache/Cypress/12.8.1/Cypress/Cypress' ], sandbox: false, runProject: '/home/michael/projects/cypress-ts-import', cwd: '/home/michael/projects/cypress-ts-import', userNodePath: '/home/michael/.volta/tools/image/node/18.12.1/bin/node', userNodeVersion: '18.12.1', invokedFromCli: true, config: {}, projectRoot: '/home/michael/projects/cypress-ts-import' } +0ms
  cypress:server:cypress from argv [ '/home/michael/.cache/Cypress/12.8.1/Cypress/Cypress', '--no-sandbox', '--run-project', '/home/michael/projects/cypress-ts-import', '--cwd', '/home/michael/projects/cypress-ts-import', '--userNodePath', '/home/michael/.volta/tools/image/node/18.12.1/bin/node', '--userNodeVersion', '18.12.1' ] got options { _: [ '/home/michael/.cache/Cypress/12.8.1/Cypress/Cypress' ], sandbox: false, runProject: '/home/michael/projects/cypress-ts-import', cwd: '/home/michael/projects/cypress-ts-import', userNodePath: '/home/michael/.volta/tools/image/node/18.12.1/bin/node', userNodeVersion: '18.12.1', invokedFromCli: true, config: {}, projectRoot: '/home/michael/projects/cypress-ts-import' } +9ms
  cypress:server:cypress scaling electron app in headless mode +0ms
  cypress:server:appdata path: /home/michael/.config/Cypress/cy/production +70ms
[95991:0317/144803.835262:WARNING:sandbox_linux.cc(380)] InitializeSandbox() called with multiple threads in process gpu-process.
[95834:0317/144803.842320:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.
  cypress:server:cypress starting in mode run with options { _: [ '/home/michael/.cache/Cypress/12.8.1/Cypress/Cypress' ], sandbox: false, runProject: '/home/michael/projects/cypress-ts-import', cwd: '/home/michael/projects/cypress-ts-import', userNodePath: '/home/michael/.volta/tools/image/node/18.12.1/bin/node', userNodeVersion: '18.12.1', invokedFromCli: true, config: {}, projectRoot: '/home/michael/projects/cypress-ts-import' } +83ms
  cypress:server:cypress running Electron currently +1ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudLatestRunUpdateSpecData +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudProjectBySlug +1ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudProjectsBySlugs +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudSpecByPath +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.cloudViewer +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.pollingIntervals +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for Query.versions +0ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for CurrentProject.cloudProject +1ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for RemoteFetchableCloudProjectResult.data +3ms
  cypress:graphql:nexusDeferIfNotLoadedPlugin Adding nexusDeferIfNotLoadedPlugin for RemoteFetchableCloudProjectSpecResult.data +0ms
  cypress:server:browsers:utils getBrowsers +0ms
  cypress:launcher:detect detecting if the following browsers are present [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', versionRegex: /Google Chrome (\S+)/m, binary: [ 'google-chrome', 'chrome', 'google-chrome-stable' ], minSupportedVersion: 64 }, { name: 'chromium', family: 'chromium', channel: 'stable', displayName: 'Chromium', versionRegex: /Chromium (\S+)/m, binary: [ 'chromium-browser', 'chromium' ], minSupportedVersion: 64 }, { name: 'chrome', family: 'chromium', channel: 'beta', displayName: 'Chrome Beta', versionRegex: /Google Chrome (\S+) beta/m, binary: 'google-chrome-beta', minSupportedVersion: 64 }, { name: 'chrome', family: 'chromium', channel: 'canary', displayName: 'Canary', versionRegex: /Google Chrome Canary (\S+)/m, binary: 'google-chrome-canary', minSupportedVersion: 64 }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', versionRegex: /^Mozilla Firefox ([^\sab]+)$/m, binary: 'firefox', minSupportedVersion: 86, validator: [Function: validator] }, { name: 'firefox', family: 'firefox', channel: 'dev', displayName: 'Firefox Developer Edition', versionRegex: /^Mozilla Firefox (\S+b\S*)$/m, binary: [ 'firefox-developer-edition', 'firefox' ], minSupportedVersion: 86 }, { name: 'firefox', family: 'firefox', channel: 'nightly', displayName: 'Firefox Nightly', versionRegex: /^Mozilla Firefox (\S+a\S*)$/m, binary: [ 'firefox-nightly', 'firefox-trunk' ], minSupportedVersion: 86 }, { name: 'edge', family: 'chromium', channel: 'stable', displayName: 'Edge', versionRegex: /Microsoft Edge (\S+)/im, binary: [ 'edge', 'microsoft-edge' ], minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'canary', displayName: 'Edge Canary', versionRegex: /Microsoft Edge.+?(\S*(?= canary)|(?<=canary )\S*)/im, binary: [ 'edge-canary', 'microsoft-edge-canary' ], minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'beta', displayName: 'Edge Beta', versionRegex: /Microsoft Edge.+?(\S*(?= beta)|(?<=beta )\S*)/im, binary: [ 'edge-beta', 'microsoft-edge-beta' ], minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'dev', displayName: 'Edge Dev', versionRegex: /Microsoft Edge.+?(\S*(?= dev)|(?<=dev )\S*)/im, binary: [ 'edge-dev', 'microsoft-edge-dev' ], minSupportedVersion: 79 } ] +0ms
  cypress:server:browsers:utils WebKit is enabled, but there was an error constructing the WebKit browser: { err: Error: Cannot find module 'playwright-webkit' Require stack: - /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/packages/server/lib/browsers/utils.ts     at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)     at n._resolveFilename (node:electron/js2c/browser_init:249:1105)     at resolve (node:internal/modules/cjs/helpers:108:19) at Function.resolve (evalmachine.<anonymous>:1:733924) at N (<embedded>:4649:307730) at Object.I [as getBrowsers] (<embedded>:4649:308565) at b.machineBrowsers (<embedded>:4190:436794) at T._setCurrentProject (<embedded>:4419:35610) at new T (<embedded>:4419:28856) at new I (<embedded>:4419:81094) at N (<embedded>:4721:437435) at s.exports (<embedded>:4721:529770) at <embedded>:4728:2607 at tryCatcher (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23) at Function.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/method.js:39:29) at Object.runElectron (<embedded>:4728:2377) at Object.startInMode (<embedded>:4728:4857) at <embedded>:4728:3945 at tryCatcher (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromise0 (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:694:18) at Promise._fulfill (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:638:18) at Promise._settlePromise (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:582:21) at Promise._settlePromise0 (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:694:18) at Promise._fulfill (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:638:18) at Promise._settlePromise (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:582:21) at Promise._settlePromise0 (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:694:18) at Promise._fulfill (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:638:18) at PromiseArray._resolve (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise_array.js:126:19) at PromiseArray._promiseFulfilled (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise_array.js:144:14) at Promise._settlePromise (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:574:26) at Promise._settlePromise0 (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:694:18) at Promise._fulfill (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/promise.js:638:18) at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/bluebird/js/release/nodeback.js:42:21 at <embedded>:1955:88964 { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/packages/server/lib/browsers/utils.ts' ] } } +2ms
  cypress:data-context:sources:GitDataSource config: { isRunMode: true, projectRoot: '/home/michael/projects/cypress-ts-import', onError: [Function (anonymous)], onBranchChange: [Function: onBranchChange], onGitInfoChange: [Function: onGitInfoChange], onGitLogChange: [AsyncFunction: onGitLogChange] } +0ms
  cypress:scaffold-config:detect Checking for default Cypress config file +0ms
  cypress:scaffold-config:detect Detected cypress.config.ts - using TS +1ms
  cypress:server:video using ffmpeg from /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@ffmpeg-installer/linux-x64/ffmpeg +0ms
  cypress:server:performance-benchmark elapsed time at run mode ready: 387.019ms +0ms
  cypress:lifecycle:ProjectConfigIpc fork child process { CHILD_PROCESS_FILE_PATH: '/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/require_async_child.js', configProcessArgs: [ '--projectRoot', '/home/michael/projects/cypress-ts-import', '--file', '/home/michael/projects/cypress-ts-import/cypress.config.ts' ], childOptions: { stdio: 'pipe', cwd: '/home/michael/projects/cypress-ts-import', execPath: '/home/michael/.volta/tools/image/node/18.12.1/bin/node' } } +0ms
  cypress:lifecycle:ProjectConfigIpc found typescript in /home/michael/projects/cypress-ts-import +0ms
  cypress:lifecycle:ProjectConfigIpc using cjs with --require /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/register_ts_node.js +0ms
  cypress:lifecycle:ProjectConfigIpc trigger the load of the file +11ms
  cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────────────┬──────────────┬────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │       group       │ processCount │      pids      │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────────────┼──────────────┼────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │     'cypress'     │      1       │    '95834'     │     0      │       0        │  308.43  │    308.43    │   308.43    │
  cypress:server:util:process_profiler │    1    │ 'electron-shared' │      2       │ '95836, 95837' │     0      │       0        │  96.43   │    96.43     │    96.43    │
  cypress:server:util:process_profiler │    2    │      'other'      │      2       │ '95976, 95977' │     0      │       0        │   2.48   │     2.48     │    2.48     │
  cypress:server:util:process_profiler │    3    │      'TOTAL'      │      5       │      '-'       │     0      │       0        │  407.33  │    407.33    │   407.33    │
  cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +0ms
  cypress:server:register-ts-node executing register_ts_node with args { _: [ '/home/michael/.volta/tools/image/node/18.12.1/bin/node', '/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/require_async_child.js' ], projectRoot: '/home/michael/projects/cypress-ts-import', file: '/home/michael/projects/cypress-ts-import/cypress.config.ts' } +0ms
  cypress:server:register-ts-node registering ts-node for projectRoot: /home/michael/projects/cypress-ts-import and file: /home/michael/projects/cypress-ts-import/cypress.config.ts +3ms
  cypress:server:ts-node projectRoot path: /home/michael/projects/cypress-ts-import +0ms
  cypress:server:ts-node registeredFile: /home/michael/projects/cypress-ts-import/cypress.config.ts +0ms
  cypress:server:plugins resolving typescript with projectRoot '/home/michael/projects/cypress-ts-import' +0ms
  cypress:server:plugins resolved typescript /home/michael/projects/cypress-ts-import/node_modules/typescript/lib/typescript.js +0ms
  cypress:server:ts-node typescript path: /home/michael/projects/cypress-ts-import/node_modules/typescript/lib/typescript.js +0ms
  cypress:server:ts-node registering project TS with options { compiler: '/home/michael/projects/cypress-ts-import/node_modules/typescript/lib/typescript.js', compilerOptions: { module: 'commonjs', preserveValueImports: false }, dir: '/home/michael/projects/cypress-ts-import', transpileOnly: true } +133ms
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped
  cypress:server:browsers:utils found browsers { browsers: [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '111.0.5563.64', path: 'google-chrome', minSupportedVersion: 64, majorVersion: '111' } ] } +339ms
  cypress:lifecycle:child:run_require_async_child:96280 configFile: /home/michael/projects/cypress-ts-import/cypress.config.ts +0ms
  cypress:lifecycle:child:run_require_async_child:96280 projectRoot: /home/michael/projects/cypress-ts-import +1ms
  cypress:lifecycle:child:run_require_async_child:96280 try loading /home/michael/projects/cypress-ts-import/cypress.config.ts +2ms
  cypress:lifecycle:child:run_require_async_child:96280 Loading file /home/michael/projects/cypress-ts-import/cypress.config.ts +0ms
  cypress:lifecycle:ProjectConfigIpc error loading config {
  name: 'Error',
  message: 'Your \x1B[33mconfigFile\x1B[39m is invalid: \x1B[94m/home/michael/projects/cypress-ts-import/cypress.config.ts\x1B[39m\n' +
    '\n' +
    'It threw an error when required, check the stack trace below:',
  stack: 'TSError: ⨯ Unable to compile TypeScript:\n' +
    "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n" +
    '\n' +
    '    at createTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:311:16)\n' +
    '    at reportTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:314:23)\n' +
    '    at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:686:17\n' +
    '    at Object.compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:743:35)\n' +
    '    at Module.m._compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:856:36)\n' +
    '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)\n' +
    '    at Object.require.extensions.<computed> [as .ts] (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)\n' +
    '    at Module.load (node:internal/modules/cjs/loader:1037:32)\n' +
    '    at Function.Module._load (node:internal/modules/cjs/loader:878:12)\n' +
    '    at Module.require (node:internal/modules/cjs/loader:1061:19)\n' +
    '    at require (node:internal/modules/cjs/helpers:103:18)\n' +
    '    at loadFile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)\n' +
    '    at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)\n' +
    '    at EventEmitter.emit (node:events:513:28)\n' +
    '    at EventEmitter.emit (node:domain:489:12)\n' +
    '    at process.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)',
  type: 'CONFIG_FILE_REQUIRE_ERROR',
  details: 'TSError: ⨯ Unable to compile TypeScript:\n' +
    "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n" +
    '\n' +
    '    at createTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:311:16)\n' +
    '    at reportTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:314:23)\n' +
    '    at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:686:17\n' +
    '    at Object.compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:743:35)\n' +
    '    at Module.m._compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:856:36)\n' +
    '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)\n' +
    '    at Object.require.extensions.<computed> [as .ts] (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)\n' +
    '    at Module.load (node:internal/modules/cjs/loader:1037:32)\n' +
    '    at Function.Module._load (node:internal/modules/cjs/loader:878:12)\n' +
    '    at Module.require (node:internal/modules/cjs/loader:1061:19)\n' +
    '    at require (node:internal/modules/cjs/helpers:103:18)\n' +
    '    at loadFile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)\n' +
    '    at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)\n' +
    '    at EventEmitter.emit (node:events:513:28)\n' +
    '    at EventEmitter.emit (node:domain:489:12)\n' +
    '    at process.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)',
  isCypressErr: true,
  messageMarkdown: 'Your `configFile` is invalid: `/home/michael/projects/cypress-ts-import/cypress.config.ts`\n' +
    '\n' +
    'It threw an error when required, check the stack trace below:',
  originalError: [Object]
} +444ms
  cypress:lifecycle:ProjectConfigManager catch { name: 'Error', message: 'Your \x1B[33mconfigFile\x1B[39m is invalid: \x1B[94m/home/michael/projects/cypress-ts-import/cypress.config.ts\x1B[39m\n' + '\n' + 'It threw an error when required, check the stack trace below:', stack: 'TSError: ⨯ Unable to compile TypeScript:\n' + "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n" + '\n' + '    at createTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:311:16)\n' + '    at reportTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:314:23)\n' + '    at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:686:17\n' + '    at Object.compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:743:35)\n' + '    at Module.m._compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:856:36)\n' + '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)\n' + '    at Object.require.extensions.<computed> [as .ts] (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)\n' + '    at Module.load (node:internal/modules/cjs/loader:1037:32)\n' + '    at Function.Module._load (node:internal/modules/cjs/loader:878:12)\n' + '    at Module.require (node:internal/modules/cjs/loader:1061:19)\n' + '    at require (node:internal/modules/cjs/helpers:103:18)\n' + '    at loadFile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)\n' + '    at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)\n' + '    at EventEmitter.emit (node:events:513:28)\n' + '    at EventEmitter.emit (node:domain:489:12)\n' + '    at process.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)', type: 'CONFIG_FILE_REQUIRE_ERROR', details: 'TSError: ⨯ Unable to compile TypeScript:\n' + "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n" + '\n' + '    at createTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:311:16)\n' + '    at reportTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:314:23)\n' + '    at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:686:17\n' + '    at Object.compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:743:35)\n' + '    at Module.m._compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:856:36)\n' + '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)\n' + '    at Object.require.extensions.<computed> [as .ts] (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)\n' + '    at Module.load (node:internal/modules/cjs/loader:1037:32)\n' + '    at Function.Module._load (node:internal/modules/cjs/loader:878:12)\n' + '    at Module.require (node:internal/modules/cjs/loader:1061:19)\n' + '    at require (node:internal/modules/cjs/helpers:103:18)\n' + '    at loadFile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)\n' + '    at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)\n' + '    at EventEmitter.emit (node:events:513:28)\n' + '    at EventEmitter.emit (node:domain:489:12)\n' + '    at process.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)', isCypressErr: true, messageMarkdown: 'Your `configFile` is invalid: `/home/michael/projects/cypress-ts-import/cypress.config.ts`\n' + '\n' + 'It threw an error when required, check the stack trace below:', originalError: { name: 'TSError', message: 'Error compiling file\n' + "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n", stack: 'TSError: ⨯ Unable to compile TypeScript:\n' + "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n" + '\n' + '    at createTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:311:16)\n' + '    at reportTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:314:23)\n' + '    at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:686:17\n' + '    at Object.compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:743:35)\n' + '    at Module.m._compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:856:36)\n' + '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)\n' + '    at Object.require.extensions.<computed> [as .ts] (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)\n' + '    at Module.load (node:internal/modules/cjs/loader:1037:32)\n' + '    at Function.Module._load (node:internal/modules/cjs/loader:878:12)\n' + '    at Module.require (node:internal/modules/cjs/loader:1061:19)\n' + '    at require (node:internal/modules/cjs/helpers:103:18)\n' + '    at loadFile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)\n' + '    at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)\n' + '    at EventEmitter.emit (node:events:513:28)\n' + '    at EventEmitter.emit (node:domain:489:12)\n' + '    at process.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)', compilerErrorLocation: null } } +0ms
  cypress:lifecycle:ProjectConfigManager catch { name: 'Error', message: 'Your \x1B[33mconfigFile\x1B[39m is invalid: \x1B[94m/home/michael/projects/cypress-ts-import/cypress.config.ts\x1B[39m\n' + '\n' + 'It threw an error when required, check the stack trace below:', stack: 'TSError: ⨯ Unable to compile TypeScript:\n' + "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n" + '\n' + '    at createTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:311:16)\n' + '    at reportTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:314:23)\n' + '    at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:686:17\n' + '    at Object.compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:743:35)\n' + '    at Module.m._compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:856:36)\n' + '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)\n' + '    at Object.require.extensions.<computed> [as .ts] (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)\n' + '    at Module.load (node:internal/modules/cjs/loader:1037:32)\n' + '    at Function.Module._load (node:internal/modules/cjs/loader:878:12)\n' + '    at Module.require (node:internal/modules/cjs/loader:1061:19)\n' + '    at require (node:internal/modules/cjs/helpers:103:18)\n' + '    at loadFile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)\n' + '    at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)\n' + '    at EventEmitter.emit (node:events:513:28)\n' + '    at EventEmitter.emit (node:domain:489:12)\n' + '    at process.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)', type: 'CONFIG_FILE_REQUIRE_ERROR', details: 'TSError: ⨯ Unable to compile TypeScript:\n' + "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n" + '\n' + '    at createTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:311:16)\n' + '    at reportTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:314:23)\n' + '    at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:686:17\n' + '    at Object.compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:743:35)\n' + '    at Module.m._compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:856:36)\n' + '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)\n' + '    at Object.require.extensions.<computed> [as .ts] (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)\n' + '    at Module.load (node:internal/modules/cjs/loader:1037:32)\n' + '    at Function.Module._load (node:internal/modules/cjs/loader:878:12)\n' + '    at Module.require (node:internal/modules/cjs/loader:1061:19)\n' + '    at require (node:internal/modules/cjs/helpers:103:18)\n' + '    at loadFile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)\n' + '    at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)\n' + '    at EventEmitter.emit (node:events:513:28)\n' + '    at EventEmitter.emit (node:domain:489:12)\n' + '    at process.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)', isCypressErr: true, messageMarkdown: 'Your `configFile` is invalid: `/home/michael/projects/cypress-ts-import/cypress.config.ts`\n' + '\n' + 'It threw an error when required, check the stack trace below:', originalError: { name: 'TSError', message: 'Error compiling file\n' + "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n", stack: 'TSError: ⨯ Unable to compile TypeScript:\n' + "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n" + '\n' + '    at createTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:311:16)\n' + '    at reportTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:314:23)\n' + '    at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:686:17\n' + '    at Object.compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:743:35)\n' + '    at Module.m._compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:856:36)\n' + '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)\n' + '    at Object.require.extensions.<computed> [as .ts] (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)\n' + '    at Module.load (node:internal/modules/cjs/loader:1037:32)\n' + '    at Function.Module._load (node:internal/modules/cjs/loader:878:12)\n' + '    at Module.require (node:internal/modules/cjs/loader:1061:19)\n' + '    at require (node:internal/modules/cjs/helpers:103:18)\n' + '    at loadFile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)\n' + '    at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)\n' + '    at EventEmitter.emit (node:events:513:28)\n' + '    at EventEmitter.emit (node:domain:489:12)\n' + '    at process.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)', compilerErrorLocation: null } } +1ms
  cypress:server:cypress exiting with err {
  name: 'Error',
  message: 'Your \x1B[33mconfigFile\x1B[39m is invalid: \x1B[94m/home/michael/projects/cypress-ts-import/cypress.config.ts\x1B[39m\n' +
    '\n' +
    'It threw an error when required, check the stack trace below:',
  stack: 'TSError: ⨯ Unable to compile TypeScript:\n' +
    "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n" +
    '\n' +
    '    at createTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:311:16)\n' +
    '    at reportTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:314:23)\n' +
    '    at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:686:17\n' +
    '    at Object.compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:743:35)\n' +
    '    at Module.m._compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:856:36)\n' +
    '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)\n' +
    '    at Object.require.extensions.<computed> [as .ts] (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)\n' +
    '    at Module.load (node:internal/modules/cjs/loader:1037:32)\n' +
    '    at Function.Module._load (node:internal/modules/cjs/loader:878:12)\n' +
    '    at Module.require (node:internal/modules/cjs/loader:1061:19)\n' +
    '    at require (node:internal/modules/cjs/helpers:103:18)\n' +
    '    at loadFile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)\n' +
    '    at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)\n' +
    '    at EventEmitter.emit (node:events:513:28)\n' +
    '    at EventEmitter.emit (node:domain:489:12)\n' +
    '    at process.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)',
  type: 'CONFIG_FILE_REQUIRE_ERROR',
  details: 'TSError: ⨯ Unable to compile TypeScript:\n' +
    "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n" +
    '\n' +
    '    at createTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:311:16)\n' +
    '    at reportTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:314:23)\n' +
    '    at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:686:17\n' +
    '    at Object.compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:743:35)\n' +
    '    at Module.m._compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:856:36)\n' +
    '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)\n' +
    '    at Object.require.extensions.<computed> [as .ts] (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)\n' +
    '    at Module.load (node:internal/modules/cjs/loader:1037:32)\n' +
    '    at Function.Module._load (node:internal/modules/cjs/loader:878:12)\n' +
    '    at Module.require (node:internal/modules/cjs/loader:1061:19)\n' +
    '    at require (node:internal/modules/cjs/helpers:103:18)\n' +
    '    at loadFile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)\n' +
    '    at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)\n' +
    '    at EventEmitter.emit (node:events:513:28)\n' +
    '    at EventEmitter.emit (node:domain:489:12)\n' +
    '    at process.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)',
  isCypressErr: true,
  messageMarkdown: 'Your `configFile` is invalid: `/home/michael/projects/cypress-ts-import/cypress.config.ts`\n' +
    '\n' +
    'It threw an error when required, check the stack trace below:',
  originalError: {
    name: 'TSError',
    message: 'Error compiling file\n' +
      "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n",
    stack: 'TSError: ⨯ Unable to compile TypeScript:\n' +
      "error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.\n" +
      '\n' +
      '    at createTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:311:16)\n' +
      '    at reportTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:314:23)\n' +
      '    at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:686:17\n' +
      '    at Object.compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:743:35)\n' +
      '    at Module.m._compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:856:36)\n' +
      '    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)\n' +
      '    at Object.require.extensions.<computed> [as .ts] (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)\n' +
      '    at Module.load (node:internal/modules/cjs/loader:1037:32)\n' +
      '    at Function.Module._load (node:internal/modules/cjs/loader:878:12)\n' +
      '    at Module.require (node:internal/modules/cjs/loader:1061:19)\n' +
      '    at require (node:internal/modules/cjs/helpers:103:18)\n' +
      '    at loadFile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)\n' +
      '    at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)\n' +
      '    at EventEmitter.emit (node:events:513:28)\n' +
      '    at EventEmitter.emit (node:domain:489:12)\n' +
      '    at process.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)',
    compilerErrorLocation: null
  }
} +607ms
Your configFile is invalid: /home/michael/projects/cypress-ts-import/cypress.config.ts

It threw an error when required, check the stack trace below:

TSError: ⨯ Unable to compile TypeScript:
error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.

    at createTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:311:16)
    at reportTSError (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:314:23)
    at /home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:686:17
    at Object.compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:743:35)
    at Module.m._compile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:856:36)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Object.require.extensions.<computed> [as .ts] (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at loadFile (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)
    at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)
    at EventEmitter.emit (node:events:513:28)
    at EventEmitter.emit (node:domain:489:12)
    at process.<anonymous> (/home/michael/.cache/Cypress/12.8.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)
  cypress:server:cypress calling exit 1 +2ms
  cypress:server:cypress about to exit with code 1 +0ms
  cypress:server:browsers browsers.kill called with no active instance +0ms
  cypress:cli child event fired { event: 'exit', code: 1, signal: null } +1s
@MattyBalaam
Copy link

I have a hunch that Cypress may not be passing along all compilerOptions to TSNode. In my case I am looking at using the new TypeScript 5.0 bundler moduleResolution, but no matter what I set module to (including es2015 ) I get the error

TSError: ⨯ Unable to compile TypeScript:
error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later.

@MattyBalaam
Copy link

I have forked the test repo showing my case: https://github.com/MattyBalaam/cypress-ts-import

@lmiller1990 lmiller1990 changed the title "allowImportingTsExtensions": true causing Cypress configuration error TypeScript 5 support: "allowImportingTsExtensions": true causing Cypress configuration error Mar 21, 2023
@lmiller1990
Copy link
Contributor

I reproduced, slightly different error:

#26173

Your configFile threw an error from: cypress.config.js

We stopped running your tests because your config file crashed.

TSError: ⨯ Unable to compile TypeScript:
error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later.
error TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.

    at createTSError (/Users/lachlanmiller/code/work/cypress2/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/Users/lachlanmiller/code/work/cypress2/node_modules/ts-node/src/index.ts:863:19)
    at /Users/lachlanmiller/code/work/cypress2/node_modules/ts-node/src/index.ts:1379:34
    at Object.compile (/Users/lachlanmiller/code/work/cypress2/node_modules/ts-node/src/index.ts:1458:13)
    at Module.m._compile (/Users/lachlanmiller/code/work/cypress2/node_modules/ts-node/src/index.ts:1617:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1175:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/lachlanmiller/code/work/cypress2/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13339)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/lachlanmiller/code/work/cypress2/packages/errors/index.js:12:18)
    at Module._compile (node:internal/modules/cjs/loader:1120:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1175:10)
    at Object.require.extensions.<computed> [as .js] (/Users/lachlanmiller/code/work/cypress2/node_modules/ts-node/src/index.ts:1608:43)

@lmiller1990
Copy link
Contributor

lmiller1990 commented Mar 22, 2023

We grab the user's tsconfig compiler options: https://github.com/cypress-io/cypress/blob/98c855e462a47b778e56e033959e104dc78aeb5a/packages/server/lib/plugins/child/ts_node.js#LL37C34-L37C62

So this should "just work". I tried importing ts-node/register/transpile-only.js instead of our ts_node.js, but same error.

@lmiller1990
Copy link
Contributor

Error is throw here:

I will continue investigating.

@osmestad
Copy link

I have similar problem after updating to TS 5.0, for us it seems the new verbatimModuleSyntax option is causing problems:

/Users/oyvind/Library/Caches/Cypress/12.8.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 TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.

    at createTSError (/Users/oyvind/Library/Caches/Cypress/12.8.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:311:16)
    at reportTSError (/Users/oyvind/Library/Caches/Cypress/12.8.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:314:23)
    at /Users/oyvind/Library/Caches/Cypress/12.8.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:686:17
    at Object.compile (/Users/oyvind/Library/Caches/Cypress/12.8.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:743:35)
    at Module.m._compile (/Users/oyvind/Library/Caches/Cypress/12.8.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:856:36)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Object.require.extensions.<computed> [as .js] (/Users/oyvind/Library/Caches/Cypress/12.8.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:859:16)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Function.Module._load (node:internal/modules/cjs/loader:958:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  diagnosticCodes: [ 5104 ]
}

I assume this is related, but please let me know if I should create a new issue for it instead!

@mbp
Copy link

mbp commented Mar 23, 2023

@lmiller1990 as you asked for in #24818: Here is the component code that fails on TypeScript 5.0

MyComponent.ts:

<template>
    <span>
      <slot name="item" v-bind="{ item: item }"></slot>
    </span>
</template>

<script setup lang="ts">
interface Props {
  item: any;
}

defineProps<Props>();
</script>

MyComponent.cypress.ts:

import { mount } from 'cypress/vue';
import { h } from 'vue';
import MyComponent from './MyComponent .vue';

describe('MyComponent ', () => {
  it('should render', () => {
    mount(MyComponent , {
      props: {
        item: {
          id: 1,
          text: 'First element',
        }
      },
      slots: {
        item: ({ item }: { item: any }) =>
          h('div', {}, `${item.id} - ${item.text}`),
      },
    });
  });
});

Error is:

MyComponent.cypress.ts:7:11 - error TS2769: No overload matches this call.
  The last overload gave the following error.
    Argument of type '__VLS_WithTemplateSlots<DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ... 4 more ..., {}>, { ...; }>' is not assignable to parameter of type 'ComponentOptionsWithObjectProps<__VLS_TypePropsToRuntimeProps<Props>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, string[], string>'.
      Type '__VLS_WithTemplateSlots<DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ... 4 more ..., {}>, { ...; }>' is not assignable to type 'ComponentOptionsBase<Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & { [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined; }, ... 10 more ..., string>'.
        Types of property 'emits' are incompatible.
          Type 'ThisType<void> | (string[] & ThisType<void>) | undefined' is not assignable to type '(string[] & ThisType<void>) | undefined'.
            Type 'ThisType<void>' is not assignable to type 'string[] & ThisType<void>'.
              Type 'ThisType<void>' is missing the following properties from type 'string[]': length, pop, push, concat, and 31 more.

7     mount(ListInteractive, {
            ~~~~~~~~~~~~~~~

  node_modules/cypress/vue/dist/index.d.ts:1339:18
    1339 declare function mount<PropsOptions extends Readonly<ComponentPropsOptions>, RawBindings, D extends {}, C extends ComputedOptions = {}, M extends Record<string, Function> = {}, E extends EmitsOptions = Record<string, any>, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, EE extends string = string>(componentOptions: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, E, Mixin, Extends, EE>, options?: MountingOptions<ExtractPropTypes<PropsOptions> & PublicProps, D>): Cypress.Chainable<{
                          ~~~~~
    The last overload is declared here.


Found 1 error in MyComponent.cypress.ts:7

@lmiller1990
Copy link
Contributor

lmiller1990 commented Mar 24, 2023

Thanks! Seems TS 5 broke quite a few things, hopefully we can get it fixed in the next week or two.

@MasonM
Copy link

MasonM commented Mar 28, 2023

I ran into this too and I found a workaround, but it only works if you don't have any tests written in TypeScript: set the environment variable CYPRESS_INTERNAL_NO_TYPESCRIPT=1 to disable TypeScript entirely:

if (env.get('CYPRESS_INTERNAL_NO_TYPESCRIPT') === '1' || !projectRoot) {
return null
}

@lmiller1990 lmiller1990 self-assigned this Mar 30, 2023
@lmiller1990
Copy link
Contributor

I am working on fixing this now. This option is not even documented in the tsconfig documentation website yet, so I'll share my findings here since other people will inevitably be solving similar problems, either here or other tooling.

Here's a minimal reproduction I made.

{
  "compilerOptions": {
    "allowImportingTsExtensions": true,
    "module": "ES2015",
    "noEmit": true
  }
}
// foo.ts
export const foo = 'FOO'
import { foo } from './foo.ts'
console.log({ foo })
  • ✅ Works: NODE_OPTIONS="--loader ts-node/esm" node index.ts
  • ❌ Does not work: NODE_OPTIONS="--loader ts-node/esm/transpile-only" node index.ts

Removing transpileOnly let me go further in Cypress:

transpileOnly: true, // transpile only (no type-check) for speed
. Then I got the same error, but this time from webpack-preprocessor, probably since we also do transpileOnly there: . It is not clear on the conflict between allowImportingTsExtensions and transpileOnly yet. I will learn more, I think we need to file an issue against ts-node, but we can probably work around this in the meantime in Cypress.

@lmiller1990
Copy link
Contributor

I filed an issue on ts-node: TypeStrong/ts-node#1981

@MasonM
Copy link

MasonM commented Mar 30, 2023

@lmiller1990 Thanks! That appears to be a different issue than what's causing the "error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later" error that @MattyBalaam reported, which is what I'm stuck on. Specifically, that appears to be happening because of this line:

Should I file a separate issue for that?

@lmiller1990
Copy link
Contributor

As a follow up, seems ts-loader also may be incompatible with this new allowImportingTsExtension option, since it relies on emitting code, which is not compatible since allowImportingTsExtension requires noEmit: true. Ref: TypeStrong/ts-loader#1602.

Maybe instead of using the default webpack-preprocessor we ship, a webpack config with esbuild-loader would be an alternative. I will research a little more.

@MasonM yep, I think your issue is separate, you can file a new issue. It's in the "TypeScript 5 problems" bucket, but we should track and tackle it separately. I suspect that problem is easier to fix, now that I learned a bit about ts-node, and it's unrelated to the ts-loader issue.

@lmiller1990
Copy link
Contributor

I tried defaulting to swc-loader instead of ts-loader and everything works great. Cypress defaults to ts-loader, so it might be the case people need to change to swc-loader to use the newer TS features, at least until we update Cypress. This would be a big breaking change, though, so it won't happen for a while.

In the meantime, I will try to get a PR up fixing this (and hopefully the issue @MasonM files) and write some docs on how to use swc-loader instead of ts-loader.

@MasonM
Copy link

MasonM commented Mar 30, 2023

@lmiller1990 Thanks for the quick reply! I entered #26308 for the error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later. issue

@lmiller1990
Copy link
Contributor

lmiller1990 commented Mar 31, 2023

So for this error, relating to allowImportingTsExtensions, I do not think working around it in Cypress is the right solution. This looks like a bug in ts-node: TypeStrong/ts-node#1981

One workaround would be to remove transpileOnly. This would be a breaking change, some users may depend on the fact we use transpileOnly. It would also harm performance.

Finally, if we do remove transpileOnly, or ignore the error, we also need to do it in ts-loader: TypeStrong/ts-loader#1602. So we'd be working around two upstream issues, both of which need patching.

I think the correct course of action is to be good OSS citizens and patch ts-node and ts-loader, then update the Cypress dependencies to use those. Everyone benefits. I may take a stab at this.

I'm also curious on the use case for allowImportingTsExtensions. My understanding is this was added for Deno compatibility - I don't think using Deno with Cypress is possible right now, we are very dependent on using Node.js as the runtime. Mind sharing your use case?

@lmiller1990 lmiller1990 added the stage: awaiting external fix A 3rd party bug in Cypress - awaiting release label Mar 31, 2023
@lmiller1990
Copy link
Contributor

Oh, it looks like this is a bug in TypeScript. Seems like someone already as a PR open to fix it: microsoft/TypeScript#53599

If this is the fix, then the fix should be just waiting for the latest TS release. Cypress (and ts-node, and ts-loader) won't work with 5.0.2, so users will just need to update.

@lmiller1990
Copy link
Contributor

I tried using the next typescript version, which is 5.1.0-dev.20230402 right now, and it looks like this is fixed. Let's wait until TypeScript 5.1 is out, but for now if anyone wants to test it out, that'd be great - npm install typescript@next.

Ref: https://www.npmjs.com/package/typescript/v/5.1.0-dev.20230402
Commit: microsoft/TypeScript@b29ed18

@mla-v-office
Copy link

I have similar problem after updating to TS 5.0, for us it seems the new verbatimModuleSyntax option is causing problems:

/Users/oyvind/Library/Caches/Cypress/12.8.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 TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.

    at createTSError (/Users/oyvind/Library/Caches/Cypress/12.8.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:311:16)
    at reportTSError (/Users/oyvind/Library/Caches/Cypress/12.8.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:314:23)
    at /Users/oyvind/Library/Caches/Cypress/12.8.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:686:17
    at Object.compile (/Users/oyvind/Library/Caches/Cypress/12.8.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:743:35)
    at Module.m._compile (/Users/oyvind/Library/Caches/Cypress/12.8.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:856:36)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Object.require.extensions.<computed> [as .js] (/Users/oyvind/Library/Caches/Cypress/12.8.1/Cypress.app/Contents/Resources/app/node_modules/ts-node/dist/index.js:859:16)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Function.Module._load (node:internal/modules/cjs/loader:958:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  diagnosticCodes: [ 5104 ]
}

I assume this is related, but please let me know if I should create a new issue for it instead!

Will this be fixed as well?

@lmiller1990
Copy link
Contributor

lmiller1990 commented Apr 6, 2023

@mla-v-office not sure - we can find out, but from the stack trace, it looks like that's also an upstream issue in ts-loader or typscript itself. We can follow it up and fix it, but said fix is likely to be in one of those projects.

Is the reproduction just to a create a project with verbatimModuleSyntax?

Edit: this won't fix that error, but that is also a bug in ts-node which we use under the hood. I filed an issue. We may need to pick this up, I think the ts-node maintainer is pretty busy and could do with some help. TypeStrong/ts-node#1987

@stnokott
Copy link

stnokott commented Apr 9, 2023

I feel like this error has multiple causes, but for me it went away with Typescript 5.0.4 (possibly microsoft/TypeScript#53611)

@lmiller1990
Copy link
Contributor

Yep, this if fixed in TypeScript 5.0.4.

@Tryd0g0lik
Copy link

Tryd0g0lik commented Feb 23, 2024

Today, this '"allowImportingTsExtensions": true' option from the TS config file.
plus

// .eslintrc.js
{
"parserOptions": {
    "project": ["./tsconfig.json"],
    ...
  }
}

It an error returned Parsing error: Unknown compiler option allowImportingTsExtensions'.eslint.
And. The first row in the all files triggered how an error (below a scrin.)

What interesting. At first, a project started to "yarn" and everything works.
Last the re-setting, before is yarn after the `npm' and got an error here.

When i did the re-setting/reconfiguration was removed all the package-lock.json files and folders node_modules . Then install through a npm.

anyone familiar with the error? How to get around it?


i just created a copy 'tsconfig.base.json' and included into the .eslintrc.js. It's doesnot the option ""allowImportingTsExtensions": true,"

Screenshot_9

@jennifer-shehane jennifer-shehane removed the stage: awaiting external fix A 3rd party bug in Cypress - awaiting release label Feb 27, 2024
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

Successfully merging a pull request may close this issue.

10 participants