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(vue-tsc): throw error and hint user when vue-tsc working with typescript lower than 5.0.0 #349

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tiny-impalas-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'vite-plugin-checker': patch
---

Throw error and hint user when vue-tsc working with typescript lower than 5.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export async function prepareVueTsc() {
const vueTscFlagFile = path.resolve(targetTsDir, 'vue-tsc-resolve-path')
const currTsVersion = _require('typescript/package.json').version

const tsMajorVersion = Number(currTsVersion.split('.')[0])
if (tsMajorVersion < 5) {
throw new Error(
"\x1b[35m[vite-plugin-checker] Since 0.7.0, vue-tsc checkers requires TypeScript 5.0.0 or newer version.\nPlease upgrade TypeScript, or use v0.6.4 which works with vue-tsc^1 if you can't upgrade. Check the pull request https://github.com/fi3ework/vite-plugin-checker/pull/327 for detail.\x1b[39m\n"
)
}

let shouldBuildFixture = true
try {
await access(targetTsDir)
Expand Down