microsoft / microsoft/TypeScript

`'X' only refers to a type` error in JSDoc comments

Open
#59,401 2 comments 0 reactions 1 assignee View on GitHub

@gabritto is already working on this.

Since Jul 24, 2024.

Bug Domain: check: Error Instability Needs Human Review Needs More Info
Dominant language
Go
Stars
111k
Forks
14.4k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

🔎 Search Terms
  • JSDoc
  • only refers to a type
  • @link
🕗 Version & Regression Information

5.6.0-dev.20240723

Not a regression

⏯ Playground Link

No response

💻 Code

When editing JSDoc comments that use @link, I occasionally see errors such as:

'TextDocument' only refers to a type, but is being used as a value here.ts(2693)

This seems to happen most often in larger projects, such as the VS Code codebase

As soon as I make another edit, the error goes away

Attached log shows the error showing up and then going away once an edit is made: tsserver.log

🙁 Actual behavior

Transient errors are occasionally reported. Seems to happen most often when editing jsdoc comments

🙂 Expected behavior

No error. The code is valid

Additional information about the issue

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.