From 7b74ea510544b050f546659a4302fa9ad9fe4046 Mon Sep 17 00:00:00 2001 From: daiwei Date: Thu, 4 Dec 2025 17:26:08 +0800 Subject: [PATCH 1/4] fix: recompile all files when compiler changes --- src/store.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/store.ts b/src/store.ts index 3af17d4e..49af8167 100644 --- a/src/store.ts +++ b/src/store.ts @@ -107,6 +107,15 @@ export function useStore( { immediate: true }, ) + // recompile all files when compiler changes + watch(compiler, (_, oldCompiler) => { + // skip initial (oldCompiler is undefined on first run) + if (!oldCompiler) return + for (const file of Object.values(files.value)) { + compileFile(store, file) + } + }) + watch( sfcOptions, () => { From bfc4ca614fcf11d0980d7f61975d181cd42335c5 Mon Sep 17 00:00:00 2001 From: daiwei Date: Thu, 4 Dec 2025 17:31:44 +0800 Subject: [PATCH 2/4] chore: error handling --- src/store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store.ts b/src/store.ts index 49af8167..82be3eba 100644 --- a/src/store.ts +++ b/src/store.ts @@ -112,7 +112,7 @@ export function useStore( // skip initial (oldCompiler is undefined on first run) if (!oldCompiler) return for (const file of Object.values(files.value)) { - compileFile(store, file) + compileFile(store, file).then((errs) => errors.value.push(...errs)) } }) From 1af01e895a20abe32f6b6747b998c79e68080551 Mon Sep 17 00:00:00 2001 From: daiwei Date: Thu, 4 Dec 2025 20:27:44 +0800 Subject: [PATCH 3/4] chore: update --- src/store.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/store.ts b/src/store.ts index 82be3eba..d151abc0 100644 --- a/src/store.ts +++ b/src/store.ts @@ -107,12 +107,14 @@ export function useStore( { immediate: true }, ) - // recompile all files when compiler changes + // recompile vue sfc files when compiler changes watch(compiler, (_, oldCompiler) => { // skip initial (oldCompiler is undefined on first run) if (!oldCompiler) return for (const file of Object.values(files.value)) { - compileFile(store, file).then((errs) => errors.value.push(...errs)) + if (file.filename.endsWith('.vue')) { + compileFile(store, file).then((errs) => errors.value.push(...errs)) + } } }) From 84401481307072dae7924e58d2b9f5adcaf6c38a Mon Sep 17 00:00:00 2001 From: daiwei Date: Thu, 4 Dec 2025 20:39:53 +0800 Subject: [PATCH 4/4] fix: enhance Vue SFC recompilation on compiler changes --- src/store.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/store.ts b/src/store.ts index d151abc0..7065bbcc 100644 --- a/src/store.ts +++ b/src/store.ts @@ -107,9 +107,11 @@ export function useStore( { immediate: true }, ) - // recompile vue sfc files when compiler changes + // Recompile all Vue SFC files when the compiler changes. + // This ensures that when switching Vue versions (e.g., from <3.6 to >=3.6), + // all vue sfc files are recompiled with the new compiler to correctly handle + // vapor components. watch(compiler, (_, oldCompiler) => { - // skip initial (oldCompiler is undefined on first run) if (!oldCompiler) return for (const file of Object.values(files.value)) { if (file.filename.endsWith('.vue')) {