Backtestsvuerun-20261007-145226#15217

Issue #15217 Merged fix PR #15219 Run 7 Oct 2026 · run-20261007-145226 vuejs/core

The Playground's TS version is set to 7 by default.

Better

Our patch was judged better than the merged fix.

In this judgment, Patch A = our agent, Patch B = the merged fix.

The two fixes are functionally identical. Each passes `typescriptVersion: ref('6.0.3')` into `useStore` in `App.vue`, so @vue/repl no longer falls back to the npm `latest` tag, which is now TS 7. That addresses the root cause in the issue: the playground defaults to an unsupported TS major. On correctness neither patch is ahead. Both rely on @vue/repl's existing `typescriptVersion` option, and both still let a hash-serialized or user-selected version override the default.

The difference is in tests and craft. Patch A moves the constant into `src/typescriptVersion.ts` with a comment explaining why it is pinned and that it must stay in sync with the root devDependency. It also adds a spec with three checks: the value is an exact semver pin, the major is below 7, and it matches the root `package.json` TypeScript devDependency. The first two checks are close to constant assertions. The sync check has real value, because it catches drift when the repo upgrades TypeScript. It could become brittle if the root uses a range that differs from the pin, but it states an intended invariant explicitly.

Patch B inlines an uncommented magic constant in `App.vue` and adds no tests. Patch A's extra file and test are small and low-risk, and they make the reason for the pin clear. Patch A therefore wins on the test and craft criteria, with correctness equal.

The judge saw only the two patches, labelled A and B in random order, with issue links and version numbers removed. The reasoning above is shown verbatim.

Solve

6m 1s

Wall-clock time in the container

Full test suite

No new failures

3,677 passed · 6 skipped · 3,683 total

Contamination audit

Clean

No sign the agent saw the real fix

Patch size

28vs 3 merged

Changed lines, ours vs merged

Vue version

commit(d2c458b)

Link to minimal reproduction

https://play.vuejs.org/

Steps to reproduce

  1. open Playground: https://play.vuejs.org/
  2. TS version has been set latest and it's over 7.

What is expected?

It's not friendly for someone new to Vue and they don't know that Vue doesn't support TS7 at this time.
I think this is temporary issue, but until Vue supports TS7, It is helpful to tell that.

Or rather, the TS version should default to TS6, not the latest.

What is actually happening?

Broken type support if TS version is not changed.

<img width="470" height="265" alt="Image" src="https://github.com/user-attachments/assets/a5f13371-1180-4c6f-8714-06f32f7c11c8" />

System Info

Any additional comments?

_No response_

The two patches

Our patch+28 −0
packages-private/sfc-playground/__tests__/typescriptVersion.spec.tsnew file mode 100644index 000000000..1f63735c3@@ -0,0 +1,22 @@+import { readFileSync } from 'node:fs'+import path from 'node:path'+import { DEFAULT_TYPESCRIPT_VERSION } from '../src/typescriptVersion'++describe('sfc-playground: default TypeScript version', () => {+  test('is pinned instead of following the npm latest tag', () => {+    expect(DEFAULT_TYPESCRIPT_VERSION).toMatch(/^\d+\.\d+\.\d+$/)+  })++  test('is not TypeScript 7+, which Vue language tools do not support yet', () => {+    const major = parseInt(DEFAULT_TYPESCRIPT_VERSION.split('.')[0], 10)+    expect(major).toBeLessThan(7)+  })++  test('matches the TypeScript version used by the repo itself', () => {+    const rootPkg = JSON.parse(+      readFileSync(path.resolve(__dirname, '../../../package.json'), 'utf-8'),+    )+    const repoVersion = rootPkg.devDependencies.typescript.replace(/^[~^]/, '')+    expect(DEFAULT_TYPESCRIPT_VERSION).toBe(repoVersion)+  })+})packages-private/sfc-playground/src/App.vueindex 7020211f4..bf6a2221d 100644@@ -3,6 +3,7 @@ import Header from './Header.vue' import { Repl, useStore, SFCOptions, useVueImportMap } from '@vue/repl' import Monaco from '@vue/repl/monaco-editor' import { ref, watchEffect, onMounted, computed, watch } from 'vue'+import { DEFAULT_TYPESCRIPT_VERSION } from './typescriptVersion'  const replRef = ref<InstanceType<typeof Repl>>() @@ -70,6 +71,7 @@ const store = useStore(     builtinImportMap: importMap,     vueVersion,     sfcOptions,+    typescriptVersion: ref(DEFAULT_TYPESCRIPT_VERSION),   },   hash, )packages-private/sfc-playground/src/typescriptVersion.tsnew file mode 100644index 000000000..b4cc000fd@@ -0,0 +1,4 @@+// Vue's language tools don't support TypeScript 7+ yet, so the playground+// must not default to the npm `latest` tag (which @vue/repl uses otherwise).+// Keep in sync with the root `typescript` devDependency.+export const DEFAULT_TYPESCRIPT_VERSION = '6.0.3' 
Merged fix · PR #15219+3 −0
packages-private/sfc-playground/src/App.vueindex 7020211f4..5a87a1d1d 100644@@ -14,6 +14,8 @@ setVH()  const useSSRMode = ref(false) +const DEFAULT_TYPESCRIPT_VERSION = '6.0.3'+ const AUTO_SAVE_STORAGE_KEY = 'vue-sfc-playground-auto-save' const initAutoSave: boolean = JSON.parse(   localStorage.getItem(AUTO_SAVE_STORAGE_KEY) ?? 'true',@@ -69,6 +71,7 @@ const store = useStore(   {     builtinImportMap: importMap,     vueVersion,+    typescriptVersion: ref(DEFAULT_TYPESCRIPT_VERSION),     sfcOptions,   },   hash,