Skip to content

vue-tsc doesn't report parsing errors in CLI mode #6037

Description

@HowieHz

Vue - Official extension or vue-tsc version

3.2.8

VSCode version

N/A

Vue version

3.5.34

TypeScript version

5.9.3

System Info

System:
    OS: Windows 11 10.0.26200
    CPU: (24) x64 AMD Ryzen AI 9 HX 370 w/ Radeon 890M
    Memory: 13.60 GB / 31.12 GB
  Binaries:
    Node: 25.9.0
    npm: 11.12.1
    pnpm: 10.33.3
  Browsers:
    Edge: Chromium (140.0.3485.54)

package.json dependencies

{
    "root": {
      "dependencies": {
        "alpinejs": "^3.15.12",
        "instant.page": "^5.2.0",
        "mermaid": "^11.14.0"
      },
      "devDependencies": {
        "vue-tsc": "^3.2.8"
      }
    },
    "docs": {
      "dependencies": {
        "chart.js": "^4.5.1",
        "vue-chartjs": "^5.3.3"
      },
      "devDependencies": {
        "vitepress": "2.0.0-alpha.17",
        "vue": "^3.5.34"
      }
    }
  }

Steps to reproduce

  1. Use a file that goes through file-md parsing.
  2. Add content like this:
<input
  pattern="[0-9]*"
>

[compat-finder](https://www.npmjs.com/package/compat-finder)
  1. Run vue-tsc in CLI mode.
  2. Compare with LSP diagnostics in the editor.

What is expected?

Parsing errors should be reported in CLI mode too.

What is actually happening?

vue-tsc doesn't report parsing errors in CLI mode; the error is only visible in LSP mode. The markdown link transforms the content into invalid text, which makes the Vue SFC parser fail.

Link to minimal reproduction

N/A

Any additional comments?

vue-tsc doesn't report parsing errors in CLI mode (it reports them in LSP mode only). That's why this error wasn't visible before. In contrast, Golar reports all parsing errors in CLI mode.

The error comes from a bug in file-md plugin

This line (

// [foo](http://foo.com)
.replace(linkReg, match => ' '.repeat(match.length));
)

content = content
	// [foo](http://foo.com)
	.replace(linkReg, match => ' '.repeat(match.length));

transforms

<input
  pattern="[0-9]*"


[compat-finder](https://www.npmjs.com/package/compat-finder)

into

<input
  pattern="                                                                       

That's why the Vue SFC parser fails to parse it.

Unfortunately, this can't be fixed on the Golar side, I recommend reporting this bug upstream.

Originally posted by @auvred in #24

Metadata

Metadata

Assignees

No one assigned

    Labels

    good reproduction ✨This issue provides a good reproduction, we will be able to investigate it first🔨 p3-minor-bug

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions