Skip to content

Since 5.0, the function parseJsonConfigFileContent is no longer built-in in _tsc.jsΒ #62577

@Imgodmaoyouknow

Description

@Imgodmaoyouknow

πŸ”Ž Search Terms

parseJsonConfigFileContent
parseJsonConfigFileContent is not defined

πŸ•— Version & Regression Information

  • This changed between versions 5.0 and 5.9.3

⏯ Playground Link

No response

πŸ’» Code

// index.ts
const a: number = "a";
npm init
npm install vue-tsc
npx vue-tsc index.ts --noEmit

πŸ™ Actual behavior

In version 4.x, the function parseJsonConfigFileContent in commandLineParser.ts will be packed in tsc.js.

but in version 5.x, it will be tree-shaked with esbuild. The final product does not include this function.

Tools such as vue-tsc will use this function, will report errors:

pnpm exec vue-tsc index.ts --noEmit

D:\test code\test 1\node_modules\.pnpm\vue-tsc@3.1.1_typescript@5.9.3\node_modules\vue-tsc\index.js:36
            throw err;
            ^

ReferenceError: parseJsonConfigFileContent is not defined
    at eval (eval at get (D:\test code\test 1\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\lib\tsc.js:122085:240), <anonymous>:1:1)
    at Object.get (D:\test code\test 1\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\lib\tsc.js:122085:240)
    at Object.createParsedCommandLineByJson (D:\test code\test 1\node_modules\.pnpm\@vue+language-core@3.1.1_typescript@5.9.3\node_modules\@vue\language-core\lib\compilerOptions.js:27:23)
    at D:\test code\test 1\node_modules\.pnpm\vue-tsc@3.1.1_typescript@5.9.3\node_modules\vue-tsc\index.js:14:20
    at Object.apply (D:\test code\test 1\node_modules\.pnpm\@volar+typescript@2.4.23\node_modules\@volar\typescript\lib\node\proxyCreateProgram.js:50:33)
    at performCompilation (D:\test code\test 1\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\lib\tsc.js:132244:19)
    at executeCommandLineWorker (D:\test code\test 1\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\lib\tsc.js:132086:7)        
    at executeCommandLine (D:\test code\test 1\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\lib\tsc.js:132133:12)
    at Object.<anonymous> (D:\test code\test 1\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\lib\tsc.js:133824:1)
    at Module._compile (node:internal/modules/cjs/loader:1554:14)

Node.js v22.14.0

πŸ™‚ Expected behavior

The function parseJsonConfigFileContent built-in _tsc.js.

Then vue-tsc can work.

Additional information about the issue

Thank you for read this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalRelates to another program, environment, or user action which we cannot control.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions