Skip to content

Cypress fails to start if tsconfig contains "allowImportingTsExtensions": true #28442

@sapphi-red

Description

@sapphi-red

Current behavior

If the directory has Cypress and TypeScript 4.9 and the tsconfig.json in the parent directory has "allowImportingTsExtensions": true, Cypress outputs the following message and hangs forever.

> [email protected] cypress:run
> cypress run

DevTools listening on ws://127.0.0.1:59272/devtools/browser/149879ae-3731-4086-862e-972b8c2e2999   

node:internal/process/esm_loader:40
      internalBinding('errors').triggerUncaughtException(
                                ^
[Object: null prototype] {
  [Symbol(nodejs.util.inspect.custom)]: [Function: [nodejs.util.inspect.custom]]
}

Desired behavior

Cypress doesn't hang and either of:

  1. Shows an error that "allowImportingTsExtensions" is unknown for TS4.9.
  2. Just runs without an error as no TypeScript file exists in the foo directory.

Test code to reproduce

  1. Clone https://github.com/sapphi-red-repros/cypress-fails-to-start-allow-ts-extension-ts-4.9
  2. Run npm i
  3. Run cd foo && npm i
  4. Run npm run cypress:run
  5. Cypress outputs the message described above and hangs forever

Cypress Version

13.5.1, 13.6.0, 13.8.1, 13.15.1

Node version

v20.9.0, v20.18.0

Operating System

Windows 11 Pro 22H2 22621.2715

Debug Logs

No response

Other

I guess it's related to #28385.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions