Skip to content

Error message printed to the console: Couldn't find tsconfig.json. tsconfig-paths will be skipped #22273

@ptarczon

Description

@ptarczon

Current behavior

Similar issue as this but with version 10.1.0
Using a tsconfig.json in the cypress directory according to the documentation
Run the command npx cypress open
The output displays:
Couldn't find tsconfig.json. tsconfig-paths will be skipped

Moving tsconfig.json to the root of the project helped but then another error was printed:

Missing baseUrl in compilerOptions. tsconfig-paths will be skipped

Adding "baseUrl": "./", to the compilerOptions made error disappear but not sure what is this baseUrl since documentation says baseUrl should be placed in cypress.config.ts

Desired behavior

No such error printed to the console.

Test code to reproduce

mkdir sample-project
cd sample-project
npm init --force
npm i --save-dev cypress typescript
npx cypress open --e2e --browser chrome
click continue button
quit cypress runner
cd cypress
touch tsconfig.json // paste contents in this file
cd ../
npx cypress open

contents of tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["es5", "dom"],
    "types": ["cypress", "node"]
  },
  "include": ["**/*.ts"]
}

Logs:

❯ mkdir sample-project
❯ cd sample-project
❯ npm init --force
npm WARN using --force Recommended protections disabled.
Wrote to /Users/piotrtarczon/VSCprojects/sample-project/package.json:

{
  "name": "sample-project",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}


❯ npm i --save-dev cypress typescript

added 166 packages, and audited 167 packages in 1s

27 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
❯ npx cypress open --e2e --browser chrome
objc[34125]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa4ead6318) and /Users/piotrtarczon/Library/Caches/Cypress/10.1.0/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x111c759c8). One of the two will be used. Which one is undefined.
Couldn't find tsconfig.json. tsconfig-paths will be skipped
GET /__/ 200 7.732 ms - -
GET /__/assets/index.0128a075.css 200 5.049 ms - -
GET /__/assets/index.a96bfe29.js 200 70.632 ms - -
GET /chrome-variations/seed?osname=mac&channel=stable&milestone=102 304 673.540 ms - -
POST /ListAccounts?gpsia=1&source=ChromiumBrowser&json=standard 200 690.160 ms - -
GET /__cypress/runner/cypress_runner.css 200 3.085 ms - -
GET /__cypress/runner/cypress_runner.js 200 5.155 ms - -
GET /__/assets/Specs.ec514639.js 200 1.491 ms - 479
GET /__/assets/Index.8f76e9d7.css 200 4.905 ms - -
GET /__/assets/add-large_x16.34ef0540.js 200 7.495 ms - 753
GET /__/assets/Index.2108bd02.js 200 6.425 ms - -
GET /__/assets/SpecPatterns.5862fb95.js 200 9.320 ms - -
GET /__/assets/warning_x16.d9896e59.js 200 25.384 ms - -
GET /__/assets/CreateSpecModal.7b82dc44.js 200 15.439 ms - -
GET /__/assets/settings_x16.2429c71a.js 200 27.289 ms - -
GET /__/assets/cypress_s.29af549a.png 200 7.971 ms - 4425
GET /__/assets/chrome.1b5cb774.svg 200 1.342 ms - -
GET /__/assets/electron.fb07f5cc.svg 200 1.916 ms - -
GET /__/assets/firefox.9be61e66.svg 200 2.545 ms - -
GET /__cypress/runner/favicon.ico?v2 404 0.973 ms - 136
GET /__cypress/assets/favicon.png?v2 404 1.132 ms - 136
POST /v1:GetModels?key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw 200 766.750 ms - -
❯ cd cypress
❯ touch tsconfig.json
❯ cd ../
❯ npx cypress open
objc[34991]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa4ead6318) and /Users/piotrtarczon/Library/Caches/Cypress/10.1.0/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x1124469c8). One of the two will be used. Which one is undefined.
Couldn't find tsconfig.json. tsconfig-paths will be skipped

Cypress Version

10.1.10

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    E2EIssue related to end-to-end testingReproducibleCan be reproducedtype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions