-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Error message printed to the console: Couldn't find tsconfig.json. tsconfig-paths will be skipped #22273
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
Comments
Maybe duplicate of this: #21805 |
@ptarczon thank you for reporting this issue! To answer this question...
Both TypeScript and Cypress have a property called Cypress baseUrl: "URL used as prefix for cy.visit() or cy.request() command's URL." TypeScript baseUrl: "Lets you set a base directory to resolve non-absolute module names." |
This issue covers two topics:
|
I'm facing issue #2 as @rachelruderman described it. I have a |
I'm facing this issue too. I build docker image based on |
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 If I put tsconfig.json in the root, then the error is suppressed. If I comment out my
Has Cypress 10 changed the expected location of tsconfig.json? |
Why CY makes mandatory this |
I am seeing the warning message "Couldn't find tsconfig.json. tsconfig-paths will be skipped" on Cypress 10.7.0 after running On the first run of
The warning message does not seem to affect the successful running of E2E tests written in JavaScript ( The problem is reproducible on Windows 10 and Windows 11 with Cypress 10.7.0. On Ubuntu 20.04 / 22.04 I could only reproduce with Cypress 10.0.0, not with Cypress 10.11.0. |
Following on from #22273 (comment): Uninstalling npm package browser-sync caused the warning message "Couldn't find tsconfig.json. tsconfig-paths will be skipped" on Cypress 10.7.0 to go away. browser-sync pulls in the npm package TypeScript and in my case uninstalling browser-sync also uninstalled Before uninstall:
With no Unfortunately for me this is not a solution, only a helpful troubleshooting step. As @h2oearth mentioned, I don't think that this warning should appear if the Cypress test specs do not include any TypeScript modules. The presence of an installed npm TypeScript module on its own should not trigger the warning. If this should be recorded as a separate issue, please let me know. Edit: Confirmed that issue still exists in Cypress 12.2.0, however I am now having difficulty to get the issue to reproduce reliably 🙁. Repro steps:
|
Cypress grep: - Cypress 10.0^ dependency - Grep Module import to /plugins/index.js & /support/e2e.js - Tags in use: @dev,@ stage, @integration - For more recipes: https://github.com/cypress-io/cypress-grep Cypress upgrade: - Cypress package version: 10.9.0 - Folder where tests live is renamed: from 'integration', to 'e2e' - Test files renamed: from '.spec.js', now '.cy.js' - Support files renamed from: /support/index.js, now support/e2e.js - Cypress config files changed: from cypress.json, now cypress.config.ts - Latest changes: https://docs.cypress.io/guides/references/changelog Cypress 10.9.0 known issues: - Unable to run all tests at once via Cypress GUI: cypress-io/cypress#21628 - Error Log each time tests run in terminal: cypress-io/cypress#22273 README: - grep run command - grep recipes
* Task 108196: Cypress Tags Cypress grep: - Cypress 10.0^ dependency - Grep Module import to /plugins/index.js & /support/e2e.js - Tags in use: @dev,@ stage, @integration - For more recipes: https://github.com/cypress-io/cypress-grep Cypress upgrade: - Cypress package version: 10.9.0 - Folder where tests live is renamed: from 'integration', to 'e2e' - Test files renamed: from '.spec.js', now '.cy.js' - Support files renamed from: /support/index.js, now support/e2e.js - Cypress config files changed: from cypress.json, now cypress.config.ts - Latest changes: https://docs.cypress.io/guides/references/changelog Cypress 10.9.0 known issues: - Unable to run all tests at once via Cypress GUI: cypress-io/cypress#21628 - Error Log each time tests run in terminal: cypress-io/cypress#22273 README: - grep run command - grep recipes * Task 108196: Cypress Tags - updates to README * Task 108196: Cypress Tags - fix typo - Fix typo on README
Cypress grep: - Cypress 10.0^ dependency - Grep Module import to /plugins/index.js & /support/e2e.js - Tags in use: @dev,@ stage, @integration - For more recipes: https://github.com/cypress-io/cypress-grep Cypress upgrade: - Cypress package version: 10.9.0 - Folder where tests live is renamed: from 'integration', to 'e2e' - Test files renamed: from '.spec.js', now '.cy.js' - Support files renamed from: /support/index.js, now support/e2e.js - Cypress config files changed: from cypress.json, now cypress.config.ts - Latest changes: https://docs.cypress.io/guides/references/changelog Cypress 10.9.0 known issues: - Unable to run all tests at once via Cypress GUI: cypress-io/cypress#21628 - Error Log each time tests run in terminal: cypress-io/cypress#22273 README: - grep run command - grep recipes Files removed: - test examples - Unnecessary
This comment was marked as outdated.
This comment was marked as outdated.
This is bad experience when I'm following the cookbook and facing this error. |
This annoyed me so much I actually went and created another tsconfig.json in the project's root (used it to store general settings not directly related to Cypress and set a baseUrl) and used the tsconfig.json located in the cypress/ folder to extend the one in the project's root. Message no longer appears and checked that Cypress is correctly using data from both files. |
Also encountered. Why not fix it? It's been open since June 2022 and still getting attention |
Just uninstalled the cypress. Deleted the file and folders it generated and then again run the command to install cypress. "scripts": { |
This error message is confusing. It's not clear what the implication is. My test seems to run fine. |
after adding |
It's a limitation of an old version of tsconfig-paths. It is no longer needed in >4 should cypress finally update. |
After run "npx cypress open" getting this error C:\Users\user\AppData\Local\Cypress\Cache\12.11.0\Cypress\resources\app\node_modules@opentelemetry\core\build\src\platform\node\environment.js:27 |
This comment was marked as off-topic.
This comment was marked as off-topic.
I am using nodejs version 16. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Windows 7, 64-bit |
The Cypress.io team will need to check, however https://learn.microsoft.com/en-us/lifecycle/products/windows-7 shows that Microsoft no longer supports this version of Microsoft Windows. Your problem is indeed a completely separate issue from the one you have tagged on to here. |
Okay.Thanks for your info. |
The workaround is to go to C:\Users\user\AppData\Local\Cypress\Cache\12.11.0\Cypress\resources\app\node_modules@opentelemetry\core\build\src\platform\node\environment.js (you can click it in VSC console) and change os.hostname() to hardcoded name of your machine . |
I'm facing same issue running
cypress/tsconfig.json exists but "Couldn't find tsconfig.json. tsconfig-paths will be skipped" |
I performed the following steps, and the error message disappeared: Navigate to the AppData\Roaming\Cypress\cy\production\projects directory. |
This is still happening in 12.12.0 |
Not sure if this helps anyone, but for me changing: in tsconfig resolved the issue |
I'm seeing the same error, "Couldn't find tsconfig.json. tsconfig-paths will be skipped" having installed Typescript globally on my machine for a different project, despite not using Typescript on this specific Cypress project. Unsure how to resolve. |
Hello , for me the issue get resolved when i launch cypress using sudo command on mac. |
Simple workaround: use a minimal workspace. Create a container dir in your project (sort of a sub-project that just runs the cypress tests) and put inside it: the cypress dir, a minimal package.json (no dependencies in it, so no node_modules dir), the cypress.config.ts, the tsconfig.json, etc. It works and it's tidier (see the dir/workspace structure here) |
This will be fixed by #31520 in Cypress 15 as we no longer use ts-node and need tsconfig-paths |
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:Adding
"baseUrl": "./",
to the compilerOptions made error disappear but not sure what is this baseUrl since documentation says baseUrl should be placed incypress.config.ts
Desired behavior
No such error printed to the console.
Test code to reproduce
contents of tsconfig.json:
Logs:
Cypress Version
10.1.10
Other
No response
The text was updated successfully, but these errors were encountered: