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

Bug: "File './tsconfig-base' not found" or "Cannot read file 'src/src/src/src/tsconfig-base.json'" in alpha (after ProjectService PR?) #7246

Closed
4 tasks done
jakebailey opened this issue Jul 17, 2023 · 5 comments · Fixed by #7252
Assignees
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working

Comments

@jakebailey
Copy link
Collaborator

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Issue Description

I bumped TypeScript up to the latest ts-eslint alpha to try and test out the new project service. However, I went to run a "before" benchmark and noticed that ts-eslint fails to load the configuration / tsconfig we have in the repo already, even before going to change the config.

Running eslint, I get this for each file:

/home/jabaile/work/TypeScript/src/typingsInstallerCore/_namespaces/ts.server.ts
  0:0  error  Parsing error: File './tsconfig-base' not found

/home/jabaile/work/TypeScript/src/typingsInstallerCore/_namespaces/ts.server.typingsInstaller.ts
  0:0  error  Parsing error: File './tsconfig-base' not found

/home/jabaile/work/TypeScript/src/typingsInstallerCore/_namespaces/ts.ts
  0:0  error  Parsing error: File './tsconfig-base' not found

/home/jabaile/work/TypeScript/src/typingsInstallerCore/typingsInstaller.ts
  0:0  error  Parsing error: File './tsconfig-base' not found

/home/jabaile/work/TypeScript/src/watchGuard/watchGuard.ts
  0:0  error  Parsing error: File './tsconfig-base' not found

✖ 576 problems (576 errors, 0 warnings)

Modifying our tsconfig-eslint base to instead try an explicit .json extension nets:

/home/jabaile/work/TypeScript/src/typingsInstallerCore/_namespaces/ts.server.typingsInstaller.ts
  0:0  error  Parsing error: Cannot read file 'src/src/src/src/tsconfig-base.json'

/home/jabaile/work/TypeScript/src/typingsInstallerCore/_namespaces/ts.ts
  0:0  error  Parsing error: Cannot read file 'src/src/src/src/tsconfig-base.json'

/home/jabaile/work/TypeScript/src/typingsInstallerCore/typingsInstaller.ts
  0:0  error  Parsing error: Cannot read file 'src/src/src/src/tsconfig-base.json'

/home/jabaile/work/TypeScript/src/watchGuard/watchGuard.ts
  0:0  error  Parsing error: Cannot read file 'src/src/src/src/tsconfig-base.json'

✖ 576 problems (576 errors, 0 warnings)

I suspect that maybe something regressed in said ProjectService change, but I can't be sure.

Reproduction Repository Link

https://github.com/jakebailey/TypeScript/tree/eslint-v6-alpha

Repro Steps

  1. clone the repo
  2. npm ci
  3. npx eslint .

Versions

package version
@typescript-eslint/eslint-plugin 6.0.1-alpha.28
@typescript-eslint/parser 6.0.1-alpha.28
@typescript-eslint/scope-manager 6.0.1-alpha.28
@typescript-eslint/typescript-estree 6.0.1-alpha.28
@typescript-eslint/type-utils 6.0.1-alpha.28
@typescript-eslint/utils 6.0.1-alpha.28
TypeScript 5.1.6
ESLint 8.45.0
node 20.4.0
@jakebailey jakebailey added bug Something isn't working triage Waiting for maintainers to take a look labels Jul 17, 2023
@bradzacher
Copy link
Member

The project service change was published as 6.0.1-alpha.18
So could you perhaps try 6.0.1-alpha.17 to see if it works to help us bisect?

@jakebailey
Copy link
Collaborator Author

Just checked, and 17 works while 18 does not, so that definitely narrows it down.

@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for maintainers to take a look labels Jul 17, 2023
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Jul 17, 2023
@JoshuaKGoldberg
Copy link
Member

Grr, thanks for trying this out so quickly @jakebailey. Probably saved us from an awkward quick revert after the scheduled release today. I'll revert #6754 now and file a ticket to add it back, with tests confirming this doesn't regress again.

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Jul 17, 2023

@jakebailey what version of npm are you using? 8.19.4 per the package.json, I'm guessing? On 9.6.6, I get:

$ npm ci
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @typescript-eslint/eslint-plugin@6.0.1-alpha.28
npm ERR! Found: @typescript-eslint/parser@6.0.1-alpha.28
npm ERR! node_modules/@typescript-eslint/parser
npm ERR!   dev @typescript-eslint/parser@"6.0.1-alpha.28" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @typescript-eslint/parser@"^6.0.0 || ^6.0.0-alpha" from @typescript-eslint/eslint-plugin@6.0.1-alpha.28
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR!   dev @typescript-eslint/eslint-plugin@"6.0.1-alpha.28" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @typescript-eslint/parser@6.0.0
npm ERR! node_modules/@typescript-eslint/parser
npm ERR!   peer @typescript-eslint/parser@"^6.0.0 || ^6.0.0-alpha" from @typescript-eslint/eslint-plugin@6.0.1-alpha.28
npm ERR!   node_modules/@typescript-eslint/eslint-plugin
npm ERR!     dev @typescript-eslint/eslint-plugin@"6.0.1-alpha.28" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /Users/josh/.npm/_logs/2023-07-17T13_47_07_103Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /Users/josh/.npm/_logs/2023-07-17T13_47_07_103Z-debug-0.log

I can repro your issue with npm ci --force though.

@JoshuaKGoldberg
Copy link
Member

Actually, never mind. Confirmed that main locally reproduces this issue for me while the revert in #7251 fixes the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working
Projects
None yet
3 participants