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

TS Server stats odd seeming file names when resolving json import #52704

Closed
mjbvz opened this issue Feb 9, 2023 · 2 comments
Closed

TS Server stats odd seeming file names when resolving json import #52704

mjbvz opened this issue Feb 9, 2023 · 2 comments
Labels
Not a Defect This behavior is one of several equally-correct options

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Feb 9, 2023

Related to #52695

Bug Report

🔎 Search Terms

  • fs.stat
  • statSync
  • performance

Problem

In a JS file, write:

const a = require('./x.json');

This causes TS Server to stat some odd seeming file paths, such as:

stat /Users/matb/projects/san/x.d.json.ts
stat /Users/matb/projects/san/x.json.ts
stat /Users/matb/projects/san/x.json.tsx
stat /Users/matb/projects/san/x.json.d.ts
stat /Users/matb/projects/san/x.json.js
stat /Users/matb/projects/san/x.json.jsx

Could these calls be avoided? It seems unlikely that you'd want to resolve files with those names in this case

Discovered this while working on project wide IntelliSense for web

@sheetalkamat
Copy link
Member

This is part of how module resolution works for json.
Related #51435

@RyanCavanaugh RyanCavanaugh added the Not a Defect This behavior is one of several equally-correct options label Feb 14, 2023
@github-actions
Copy link

github-actions bot commented Jun 8, 2023

This issue has been marked as 'Not a Defect' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not a Defect This behavior is one of several equally-correct options
Projects
None yet
Development

No branches or pull requests

3 participants