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

fix(tsc): log catched errors to console #4451

Merged

Conversation

mik3ybark3r
Copy link
Contributor

This prevents that the output of a successful vue-tsc run looks the same like one finished with an unexpected error.

This prevents that the output of a successful vue-tsc run looks the same like one finished with an unexpected error.
@so1ve
Copy link
Member

so1ve commented Jun 7, 2024

What kind of error do you meet?

@mik3ybark3r
Copy link
Contributor Author

In my case vue-tsc did not show any typescript errors when running with typescript version 5.1.6. I found the solution with the help of that issue: #4099
What frustrated me the most was that the following error was just catched without any output to the terminal:

ReferenceError: ScriptKind is not defined
    at eval (eval at get (/app/frontend/node_modules/typescript/lib/tsc.js:113647:179), <anonymous>:1:1)
    at Object.get (/app/frontend/node_modules/typescript/lib/tsc.js:113647:179)
    at Object.getServiceScript (/app/frontend/node_modules/@vue/language-core/lib/languageModule.js:155:46)
    at Object.fileExists (/app/frontend/node_modules/@volar/typescript/lib/resolveModuleName.js:26:105)
    at tryFileLookup (/app/frontend/node_modules/typescript/lib/tsc.js:37807:20)
    at tryFile (/app/frontend/node_modules/typescript/lib/tsc.js:37797:12)
    at tryExtension (/app/frontend/node_modules/typescript/lib/tsc.js:37790:18)
    at tryAddingExtensions (/app/frontend/node_modules/typescript/lib/tsc.js:37787:107)
    at loadModuleFromFileNoImplicitExtensions (/app/frontend/node_modules/typescript/lib/tsc.js:37747:10)
    at loadModuleFromFile (/app/frontend/node_modules/typescript/lib/tsc.js:37723:40)

The result was that we had some unknown typescript errors in the project because we weren't aware that vue-tsc is not working properly.

@johnsoncodehk
Copy link
Member

Thanks!

@johnsoncodehk johnsoncodehk merged commit fbe88a4 into vuejs:master Jun 8, 2024
3 checks passed
coderfreii pushed a commit to coderfreii/language-tools that referenced this pull request Jun 20, 2024
This prevents that the output of a successful vue-tsc run looks the same like one finished with an unexpected error.

Co-authored-by: Christian Rudolf <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants