question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
h2oearthcommented, Jul 25, 2022

Why CY makes mandatory this tsconfig.json?. We do not use TS in some of our projects and CY keeps complaining about such file!

4reactions
ShadowLNCcommented, Jul 7, 2022

Adding “baseUrl”: “./”, to the compilerOptions made error disappear

This only seems to apply if tsconfig.json is in the root, as opposed to the Cypress folder.

If I put tsconfig.json in the Cypress folder (like Rachel’s example and like the docs specify) then it seems to be ignored. Commenting or adding baseUrl has no effect on the error message.

If I put tsconfig.json in the root, then the error is suppressed. If I comment out my baseUrl declaration while tsconfig.json is in the root, I get the following:

Missing baseUrl in compilerOptions. tsconfig-paths will be skipped

Has Cypress 10 changed the expected location of tsconfig.json?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specify tsconfig.json location for Cypress - Stack Overflow
tsconfig -paths will be skipped" /src/tsconfig.json //Error: "Couldn't find tsconfig.json. tsconfig-paths will be skipped" /cypress/tsconfig.
Read more >
Configuring Jest
The file will be discovered automatically, if it is named jest.config.js|ts|mjs|cjs|json . You can use --config flag to pass an explicit path to ......
Read more >
Options | ts-node
Most options can be declared in your tsconfig.json: Configuration via tsconfig. ... -vvv includes absolute paths to ts-node and typescript installations.
Read more >
Understanding TypeScript's “Compilation Process” & the ...
You can manually provide a path to the tsconfig.json file using ... but this error tells that the TypeScript compiler couldn't find ....
Read more >
parsing error tsconfig.json Code Example - Code Grepper
“parsing error tsconfig.json” Code Answer's. Grepper Logo Small. Search. 75. Loose MatchExact ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found