From 92f669cd986d5731ea4eccf1a452d62c14fd6d0f Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 15 Jun 2026 10:20:17 +0200 Subject: [PATCH 01/12] move to node16 moduleResolution --- packages/astro/tsconfig.json | 1 + packages/browser/tsconfig.json | 1 + packages/cloudflare/tsconfig.json | 1 + packages/deno/tsconfig.json | 1 + packages/feedback/tsconfig.json | 1 + packages/hono/tsconfig.json | 1 + packages/integration-shims/tsconfig.json | 1 + packages/node-core/tsconfig.json | 4 +--- packages/node-native/tsconfig.json | 2 +- packages/node/tsconfig.json | 8 +------- packages/profiling-node/tsconfig.json | 2 +- packages/react-router/tsconfig.json | 1 + packages/replay-canvas/tsconfig.json | 3 ++- packages/replay-internal/tsconfig.json | 3 ++- packages/replay-worker/tsconfig.json | 1 + packages/server-utils/tsconfig.json | 6 +----- packages/tanstackstart/tsconfig.json | 7 +------ packages/types/tsconfig.json | 6 +----- packages/typescript/tsconfig.json | 3 ++- 19 files changed, 22 insertions(+), 31 deletions(-) diff --git a/packages/astro/tsconfig.json b/packages/astro/tsconfig.json index d1a9c722679f..0b788fab5eae 100644 --- a/packages/astro/tsconfig.json +++ b/packages/astro/tsconfig.json @@ -4,6 +4,7 @@ "include": ["src/**/*"], "compilerOptions": { + "module": "esnext", "moduleResolution": "bundler" // package-specific options } diff --git a/packages/browser/tsconfig.json b/packages/browser/tsconfig.json index 8efb233764b7..6178eb6a0df8 100644 --- a/packages/browser/tsconfig.json +++ b/packages/browser/tsconfig.json @@ -4,6 +4,7 @@ "include": ["src/**/*", "test/loader.js"], "compilerOptions": { + "module": "esnext", "moduleResolution": "bundler", "lib": ["DOM", "es2020", "WebWorker"] } diff --git a/packages/cloudflare/tsconfig.json b/packages/cloudflare/tsconfig.json index ff89f0feaa23..f5120ac13303 100644 --- a/packages/cloudflare/tsconfig.json +++ b/packages/cloudflare/tsconfig.json @@ -5,6 +5,7 @@ "compilerOptions": { "module": "esnext", + "moduleResolution": "bundler", "types": ["node", "@cloudflare/workers-types"] } } diff --git a/packages/deno/tsconfig.json b/packages/deno/tsconfig.json index fdd107c1ed78..83471a5dc7e7 100644 --- a/packages/deno/tsconfig.json +++ b/packages/deno/tsconfig.json @@ -4,6 +4,7 @@ "compilerOptions": { "lib": ["esnext"], "module": "esnext", + "moduleResolution": "bundler", "target": "esnext" } } diff --git a/packages/feedback/tsconfig.json b/packages/feedback/tsconfig.json index 50734351f40b..7e36a9efff44 100644 --- a/packages/feedback/tsconfig.json +++ b/packages/feedback/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "module": "esnext", + "moduleResolution": "bundler", /* Preact Config */ "jsx": "react-jsx", diff --git a/packages/hono/tsconfig.json b/packages/hono/tsconfig.json index ff89f0feaa23..f5120ac13303 100644 --- a/packages/hono/tsconfig.json +++ b/packages/hono/tsconfig.json @@ -5,6 +5,7 @@ "compilerOptions": { "module": "esnext", + "moduleResolution": "bundler", "types": ["node", "@cloudflare/workers-types"] } } diff --git a/packages/integration-shims/tsconfig.json b/packages/integration-shims/tsconfig.json index d1a9c722679f..0b788fab5eae 100644 --- a/packages/integration-shims/tsconfig.json +++ b/packages/integration-shims/tsconfig.json @@ -4,6 +4,7 @@ "include": ["src/**/*"], "compilerOptions": { + "module": "esnext", "moduleResolution": "bundler" // package-specific options } diff --git a/packages/node-core/tsconfig.json b/packages/node-core/tsconfig.json index 28abec410557..da581f3329ff 100644 --- a/packages/node-core/tsconfig.json +++ b/packages/node-core/tsconfig.json @@ -4,8 +4,6 @@ "include": ["src/**/*"], "compilerOptions": { - "lib": ["ES2020", "ES2021.WeakRef"], - "module": "Node16", - "moduleResolution": "Node16" + "lib": ["ES2020", "ES2021.WeakRef"] } } diff --git a/packages/node-native/tsconfig.json b/packages/node-native/tsconfig.json index b1109af19fdf..2ddae9823070 100644 --- a/packages/node-native/tsconfig.json +++ b/packages/node-native/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "module": "esnext", - "lib": ["es2020"], + "moduleResolution": "bundler", "outDir": "build", "types": ["node"] }, diff --git a/packages/node/tsconfig.json b/packages/node/tsconfig.json index d5f034ad1048..cbfffafe5ca1 100644 --- a/packages/node/tsconfig.json +++ b/packages/node/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "include": ["src/**/*"], - - "compilerOptions": { - "lib": ["es2020"], - "module": "Node16", - "moduleResolution": "Node16" - } + "include": ["src/**/*"] } diff --git a/packages/profiling-node/tsconfig.json b/packages/profiling-node/tsconfig.json index b1109af19fdf..2ddae9823070 100644 --- a/packages/profiling-node/tsconfig.json +++ b/packages/profiling-node/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "module": "esnext", - "lib": ["es2020"], + "moduleResolution": "bundler", "outDir": "build", "types": ["node"] }, diff --git a/packages/react-router/tsconfig.json b/packages/react-router/tsconfig.json index aa2dc034c7c3..2c276283f199 100644 --- a/packages/react-router/tsconfig.json +++ b/packages/react-router/tsconfig.json @@ -4,6 +4,7 @@ "include": ["src/**/*"], "compilerOptions": { + "module": "esnext", "moduleResolution": "bundler", "jsx": "react" } diff --git a/packages/replay-canvas/tsconfig.json b/packages/replay-canvas/tsconfig.json index 4f9aae5f3994..cf93e293f8ee 100644 --- a/packages/replay-canvas/tsconfig.json +++ b/packages/replay-canvas/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "lib": ["DOM", "es2020"], - "module": "esnext" + "module": "esnext", + "moduleResolution": "bundler" }, "include": ["src/**/*.ts"] } diff --git a/packages/replay-internal/tsconfig.json b/packages/replay-internal/tsconfig.json index 4f9aae5f3994..cf93e293f8ee 100644 --- a/packages/replay-internal/tsconfig.json +++ b/packages/replay-internal/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "lib": ["DOM", "es2020"], - "module": "esnext" + "module": "esnext", + "moduleResolution": "bundler" }, "include": ["src/**/*.ts"] } diff --git a/packages/replay-worker/tsconfig.json b/packages/replay-worker/tsconfig.json index 24cce469ccc3..b043123c8140 100644 --- a/packages/replay-worker/tsconfig.json +++ b/packages/replay-worker/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "module": "esnext", + "moduleResolution": "bundler", "lib": ["webworker", "scripthost"], "esModuleInterop": true, "target": "es2020", diff --git a/packages/server-utils/tsconfig.json b/packages/server-utils/tsconfig.json index eaeff42ce731..cbfffafe5ca1 100644 --- a/packages/server-utils/tsconfig.json +++ b/packages/server-utils/tsconfig.json @@ -1,9 +1,5 @@ { "extends": "../../tsconfig.json", - "include": ["src/**/*"], - - "compilerOptions": { - "lib": ["ES2020"] - } + "include": ["src/**/*"] } diff --git a/packages/tanstackstart/tsconfig.json b/packages/tanstackstart/tsconfig.json index 220ba3fa2b86..52d43eaaa9b9 100644 --- a/packages/tanstackstart/tsconfig.json +++ b/packages/tanstackstart/tsconfig.json @@ -1,9 +1,4 @@ { "extends": "../../tsconfig.json", - "include": ["src/**/*"], - "compilerOptions": { - "lib": ["es2020"], - "module": "Node16", - "moduleResolution": "Node16" - } + "include": ["src/**/*"] } diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index e712bc6f77a7..cbfffafe5ca1 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -1,9 +1,5 @@ { "extends": "../../tsconfig.json", - "include": ["src/**/*"], - - "compilerOptions": { - "lib": ["es2020"] - } + "include": ["src/**/*"] } diff --git a/packages/typescript/tsconfig.json b/packages/typescript/tsconfig.json index 2e70d1a0c493..0aaa8f81f87f 100644 --- a/packages/typescript/tsconfig.json +++ b/packages/typescript/tsconfig.json @@ -7,7 +7,8 @@ "inlineSources": true, "isolatedModules": true, "lib": ["es2020"], - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "noErrorTruncation": true, "noFallthroughCasesInSwitch": true, "noImplicitReturns": true, From e64eea5660defe1f20df6c47d009bbbca5e4dcf0 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 15 Jun 2026 10:40:05 +0200 Subject: [PATCH 02/12] fix(svelte): Keep legacy node moduleResolution for Svelte 3 deep type imports Svelte's `exports` map does not declare deep subpaths like `svelte/types/compiler/preprocess`, which our source imports (still needed for Svelte 3 support). `node16` resolution honors the `exports` map and rejects these, so pin the svelte package back to the legacy `node` resolver, which resolves them via filesystem lookup. Emitted `.d.ts` is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/svelte/tsconfig.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/svelte/tsconfig.json b/packages/svelte/tsconfig.json index fd54f069790c..58e948b84ed6 100644 --- a/packages/svelte/tsconfig.json +++ b/packages/svelte/tsconfig.json @@ -4,6 +4,11 @@ "include": ["src/**/*"], "compilerOptions": { - "lib": ["DOM", "es2020"] + "lib": ["DOM", "es2020"], + // We still support Svelte 3, which imports types from deep paths (e.g. `svelte/types/compiler/preprocess`) + // that aren't declared in Svelte's `exports` map. `node16` resolution honors that map and rejects them, + // so we keep the legacy `node` resolver here, which resolves them via filesystem lookup. + "module": "esnext", + "moduleResolution": "node" } } From 54b72360a8c334156ac7dee0836930ed9f774392 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 15 Jun 2026 10:42:36 +0200 Subject: [PATCH 03/12] fix(angular): Use esnext/bundler instead of node16 default `@sentry/angular` is `"type": "module"`, so under the new `node16` base resolution its relative imports would require explicit `.js` extensions (TS2835), breaking the `ng build`. Like our other framework packages (react, vue) it's compiled via a bundler (ng-packagr), so set `module: esnext` + `moduleResolution: bundler` explicitly. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/angular/tsconfig.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/angular/tsconfig.json b/packages/angular/tsconfig.json index 0d4d9607991a..fc9a30233785 100644 --- a/packages/angular/tsconfig.json +++ b/packages/angular/tsconfig.json @@ -6,7 +6,11 @@ "exclude": ["patch-vitest.ts", "setup-test.ts"], "compilerOptions": { - // package-specific options - "experimentalDecorators": true + "experimentalDecorators": true, + // `@sentry/angular` is `"type": "module"`, so under `node16` resolution its relative imports would + // require explicit `.js` extensions. Like our other framework packages it's compiled via a bundler + // (ng-packagr), so use `esnext`/`bundler` here instead of the `node16` default. + "module": "esnext", + "moduleResolution": "bundler" } } From 5a5b5748ce1698f90014819a4fe0d1f0f63e1265 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 15 Jun 2026 10:43:39 +0200 Subject: [PATCH 04/12] fix nx implicit dependency for typescript --- nx.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nx.json b/nx.json index 656f381d9b43..d869745b42ee 100644 --- a/nx.json +++ b/nx.json @@ -5,7 +5,8 @@ "{workspaceRoot}/*.js", "{workspaceRoot}/*.json", "{workspaceRoot}/yarn.lock", - "{workspaceRoot}/dev-packages/rollup-utils/**" + "{workspaceRoot}/dev-packages/rollup-utils/**", + "{workspaceRoot}/packages/typescript/**" ], "production": ["default", "!{projectRoot}/test/**/*", "!{projectRoot}/**/*.md", "!{projectRoot}/*.tgz"] }, From 0e8b80dff1acab8ea9d9f1490acda7792826ae9f Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 15 Jun 2026 10:43:48 +0200 Subject: [PATCH 05/12] fix test-utils module --- dev-packages/test-utils/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/dev-packages/test-utils/tsconfig.json b/dev-packages/test-utils/tsconfig.json index 9aac5ca8f289..f80703d3bca0 100644 --- a/dev-packages/test-utils/tsconfig.json +++ b/dev-packages/test-utils/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.json", "compilerOptions": { "target": "ES2022", - "module": "ES2022", // package-specific options "esModuleInterop": true }, From 1e7b2f24bddde711f9dfa5116ff500013e40a230 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 15 Jun 2026 10:44:17 +0200 Subject: [PATCH 06/12] fix(solid): Use esnext/bundler instead of node16 default `@sentry/solid` imports ESM-only deps (`solid-js`, `solid-js/web`). Under the new `node16` base resolution, a CommonJS file can't `require` an ESM module (TS1479/TS1541). Like our other framework packages it's bundled, so set `module: esnext` + `moduleResolution: bundler` explicitly. Emitted `.d.ts` is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/solid/tsconfig.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/solid/tsconfig.json b/packages/solid/tsconfig.json index fd54f069790c..ac10ca319f8f 100644 --- a/packages/solid/tsconfig.json +++ b/packages/solid/tsconfig.json @@ -4,6 +4,11 @@ "include": ["src/**/*"], "compilerOptions": { - "lib": ["DOM", "es2020"] + "lib": ["DOM", "es2020"], + // This package imports ESM-only deps (`solid-js`); under `node16` resolution a CommonJS file + // can't `require` those (TS1479/TS1541). Like our other framework packages it's compiled via a + // bundler, so use `esnext`/`bundler` here instead of the `node16` default. + "module": "esnext", + "moduleResolution": "bundler" } } From d7421e26ec3d11d419fcff270c0068e0454bac83 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 15 Jun 2026 10:55:24 +0200 Subject: [PATCH 07/12] fix(angular): Inline tsconfig instead of extending the node16 base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `@sentry/angular` is built with ng-packagr, which pins TypeScript 4.6 — that version predates `node16` and rejects the literal anywhere in the inherited config chain, even when the package overrides module/moduleResolution. So stop extending the shared base entirely and inline the effective base options here, using `esnext`/`node` (which TS 4.6 supports). Build output verified byte-identical to before. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/angular/tsconfig.json | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/packages/angular/tsconfig.json b/packages/angular/tsconfig.json index fc9a30233785..777ea3d64aa1 100644 --- a/packages/angular/tsconfig.json +++ b/packages/angular/tsconfig.json @@ -1,16 +1,35 @@ { - "extends": "../../tsconfig.json", - + // NOTE: Unlike every other package, this config does NOT extend the shared base config + // (`../../tsconfig.json`). `@sentry/angular` is built with `ng-packagr`, which pins an older + // TypeScript (4.6) that doesn't understand the `node16` module/moduleResolution our base config + // defaults to (and rejects the literal even when overridden). We therefore inline the relevant + // base compiler options here and use `esnext`/`node` instead. "include": ["**/*.ts", "src/**/*"], "exclude": ["patch-vitest.ts", "setup-test.ts"], "compilerOptions": { - "experimentalDecorators": true, - // `@sentry/angular` is `"type": "module"`, so under `node16` resolution its relative imports would - // require explicit `.js` extensions. Like our other framework packages it's compiled via a bundler - // (ng-packagr), so use `esnext`/`bundler` here instead of the `node16` default. + "declaration": false, + "declarationMap": false, + "downlevelIteration": true, + "importHelpers": true, + "inlineSources": true, + "isolatedModules": true, + "lib": ["es2020"], "module": "esnext", - "moduleResolution": "bundler" + "moduleResolution": "node", + "noErrorTruncation": true, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "sourceMap": true, + "strict": true, + "strictBindCallApply": false, + "target": "es2020", + "noUncheckedIndexedAccess": true, + "skipLibCheck": true, + "experimentalDecorators": true } } From 1c87dbe1613f74091f0f5fb12313f904c00441c7 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 15 Jun 2026 11:11:44 +0200 Subject: [PATCH 08/12] fix tests --- packages/react-router/test/server/wrapServerAction.test.ts | 1 - packages/react-router/test/server/wrapServerLoader.test.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/react-router/test/server/wrapServerAction.test.ts b/packages/react-router/test/server/wrapServerAction.test.ts index 043d838aa90a..149b90d570c0 100644 --- a/packages/react-router/test/server/wrapServerAction.test.ts +++ b/packages/react-router/test/server/wrapServerAction.test.ts @@ -120,7 +120,6 @@ describe('wrapServerAction', () => { it('should skip span creation and warn when instrumentation API is used', async () => { // Reset modules to get a fresh copy with unset warning flag vi.resetModules(); - // @ts-expect-error - Dynamic import for module reset works at runtime but vitest's typecheck doesn't fully support it const { wrapServerAction: freshWrapServerAction } = await import('../../src/server/wrapServerAction'); // Set the global flag indicating instrumentation API is in use diff --git a/packages/react-router/test/server/wrapServerLoader.test.ts b/packages/react-router/test/server/wrapServerLoader.test.ts index 7dfb39bbed42..ce3be0f4319a 100644 --- a/packages/react-router/test/server/wrapServerLoader.test.ts +++ b/packages/react-router/test/server/wrapServerLoader.test.ts @@ -120,7 +120,6 @@ describe('wrapServerLoader', () => { it('should skip span creation and warn when instrumentation API is used', async () => { // Reset modules to get a fresh copy with unset warning flag vi.resetModules(); - // @ts-expect-error - Dynamic import for module reset works at runtime but vitest's typecheck doesn't fully support it const { wrapServerLoader: freshWrapServerLoader } = await import('../../src/server/wrapServerLoader'); // Set the global flag indicating instrumentation API is in use From 638c02e1663c9f19f460132279a27dd72f45854e Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 15 Jun 2026 11:12:43 +0200 Subject: [PATCH 09/12] fix browser-integration-tests --- dev-packages/browser-integration-tests/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/dev-packages/browser-integration-tests/tsconfig.json b/dev-packages/browser-integration-tests/tsconfig.json index 05605881f5d6..5c906f72df9d 100644 --- a/dev-packages/browser-integration-tests/tsconfig.json +++ b/dev-packages/browser-integration-tests/tsconfig.json @@ -3,7 +3,6 @@ "compilerOptions": { "lib": ["dom", "ES2020"], - "moduleResolution": "node", "noEmit": true, "strict": true, "allowSyntheticDefaultImports": true, From debf405cba55f7af71a5def04f1687c7776302cb Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 15 Jun 2026 11:15:48 +0200 Subject: [PATCH 10/12] fix(test): Downgrade module/moduleResolution for TS 3.8 integration tests The TS 3.8 compatibility job patches the base tsconfig before running, but only stripped `noUncheckedIndexedAccess`. With the base now defaulting to `node16` module/moduleResolution (added in TS 4.7), TS 3.8 fails on the unrecognized literal. Downgrade both to TS 3.8-compatible `esnext`/`node` in the `use-ts-3_8.js` setup scripts for node and node-core integration tests. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../node-core-integration-tests/scripts/use-ts-3_8.js | 5 +++++ dev-packages/node-integration-tests/scripts/use-ts-3_8.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/dev-packages/node-core-integration-tests/scripts/use-ts-3_8.js b/dev-packages/node-core-integration-tests/scripts/use-ts-3_8.js index d759179f8e06..f78b78438cba 100644 --- a/dev-packages/node-core-integration-tests/scripts/use-ts-3_8.js +++ b/dev-packages/node-core-integration-tests/scripts/use-ts-3_8.js @@ -36,4 +36,9 @@ const tsConfig = require(baseTscConfigPath); // TS 3.8 fails build when it encounters a config option it does not understand, so we remove it :( delete tsConfig.compilerOptions.noUncheckedIndexedAccess; +// TS 3.8 predates `node16` module/moduleResolution (added in TS 4.7), so downgrade them to values +// TS 3.8 understands. This matches the resolution behavior these tests relied on before `node16`. +tsConfig.compilerOptions.module = 'esnext'; +tsConfig.compilerOptions.moduleResolution = 'node'; + writeFileSync(baseTscConfigPath, JSON.stringify(tsConfig, null, 2)); diff --git a/dev-packages/node-integration-tests/scripts/use-ts-3_8.js b/dev-packages/node-integration-tests/scripts/use-ts-3_8.js index d759179f8e06..f78b78438cba 100644 --- a/dev-packages/node-integration-tests/scripts/use-ts-3_8.js +++ b/dev-packages/node-integration-tests/scripts/use-ts-3_8.js @@ -36,4 +36,9 @@ const tsConfig = require(baseTscConfigPath); // TS 3.8 fails build when it encounters a config option it does not understand, so we remove it :( delete tsConfig.compilerOptions.noUncheckedIndexedAccess; +// TS 3.8 predates `node16` module/moduleResolution (added in TS 4.7), so downgrade them to values +// TS 3.8 understands. This matches the resolution behavior these tests relied on before `node16`. +tsConfig.compilerOptions.module = 'esnext'; +tsConfig.compilerOptions.moduleResolution = 'node'; + writeFileSync(baseTscConfigPath, JSON.stringify(tsConfig, null, 2)); From 6229192d1c48ac58945ffdcba9cc7ba8ef775f53 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 15 Jun 2026 11:41:01 +0200 Subject: [PATCH 11/12] fix(test): Drop module override for TS 3.8 instead of forcing esnext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous attempt set `module: esnext` when patching the base tsconfig for TS 3.8. But the integration-test scenarios run via `node -r ts-node/register`, so ts-node compiled them to ESM and they crashed on load as CommonJS — every scenario timed out. Restore the pre-`node16` base shape instead: drop `module` (ts-node falls back to CommonJS, as before) and keep `moduleResolution: node`. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../node-core-integration-tests/scripts/use-ts-3_8.js | 8 +++++--- dev-packages/node-integration-tests/scripts/use-ts-3_8.js | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dev-packages/node-core-integration-tests/scripts/use-ts-3_8.js b/dev-packages/node-core-integration-tests/scripts/use-ts-3_8.js index f78b78438cba..d7603dabbdd9 100644 --- a/dev-packages/node-core-integration-tests/scripts/use-ts-3_8.js +++ b/dev-packages/node-core-integration-tests/scripts/use-ts-3_8.js @@ -36,9 +36,11 @@ const tsConfig = require(baseTscConfigPath); // TS 3.8 fails build when it encounters a config option it does not understand, so we remove it :( delete tsConfig.compilerOptions.noUncheckedIndexedAccess; -// TS 3.8 predates `node16` module/moduleResolution (added in TS 4.7), so downgrade them to values -// TS 3.8 understands. This matches the resolution behavior these tests relied on before `node16`. -tsConfig.compilerOptions.module = 'esnext'; +// TS 3.8 predates `node16` module/moduleResolution (added in TS 4.7). Restore the pre-`node16` +// base shape: drop `module` (so ts-node, which runs the scenarios, keeps emitting CommonJS) and +// use plain `node` resolution. Setting `module` to an ESM value here breaks the `ts-node/register` +// scenarios, which are loaded as CommonJS. +delete tsConfig.compilerOptions.module; tsConfig.compilerOptions.moduleResolution = 'node'; writeFileSync(baseTscConfigPath, JSON.stringify(tsConfig, null, 2)); diff --git a/dev-packages/node-integration-tests/scripts/use-ts-3_8.js b/dev-packages/node-integration-tests/scripts/use-ts-3_8.js index f78b78438cba..d7603dabbdd9 100644 --- a/dev-packages/node-integration-tests/scripts/use-ts-3_8.js +++ b/dev-packages/node-integration-tests/scripts/use-ts-3_8.js @@ -36,9 +36,11 @@ const tsConfig = require(baseTscConfigPath); // TS 3.8 fails build when it encounters a config option it does not understand, so we remove it :( delete tsConfig.compilerOptions.noUncheckedIndexedAccess; -// TS 3.8 predates `node16` module/moduleResolution (added in TS 4.7), so downgrade them to values -// TS 3.8 understands. This matches the resolution behavior these tests relied on before `node16`. -tsConfig.compilerOptions.module = 'esnext'; +// TS 3.8 predates `node16` module/moduleResolution (added in TS 4.7). Restore the pre-`node16` +// base shape: drop `module` (so ts-node, which runs the scenarios, keeps emitting CommonJS) and +// use plain `node` resolution. Setting `module` to an ESM value here breaks the `ts-node/register` +// scenarios, which are loaded as CommonJS. +delete tsConfig.compilerOptions.module; tsConfig.compilerOptions.moduleResolution = 'node'; writeFileSync(baseTscConfigPath, JSON.stringify(tsConfig, null, 2)); From 12113fc3f40e26cc18e48250363636603e0684d4 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 15 Jun 2026 16:23:39 +0200 Subject: [PATCH 12/12] ref(typescript): Default to esnext/bundler instead of node16 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Everything we ship is bundled (Rollup emits the JS; tsc only emits .d.ts, which is byte-identical either way), so the base config now defaults to esnext/bundler — a uniform, modern default that the bundled majority of packages already used. This also avoids the node16 literal, which older toolchains (Angular's pinned TS 4.6, the TS 3.8 compat job) can't parse. Removes all now-redundant module/moduleResolution overrides across packages, leaving only genuine exceptions: - svelte: `node` resolution (Svelte 3 imports deep paths not in its exports map) - angular: inlined config with esnext/node (ng-packagr pins TS 4.6) - nextjs/remix tsconfig.test.json: Node16 (deliberately exercise node resolution) - astro tsconfig.dev.json: unchanged dev config Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/astro/tsconfig.json | 2 -- packages/browser/tsconfig.json | 2 -- packages/cloudflare/tsconfig.json | 2 -- packages/core/tsconfig.types.json | 2 -- packages/deno/tsconfig.build.json | 1 - packages/deno/tsconfig.json | 2 -- packages/deno/tsconfig.test.json | 1 - packages/effect/tsconfig.json | 2 -- packages/ember/tsconfig.json | 2 -- packages/feedback/tsconfig.json | 3 --- packages/hono/tsconfig.json | 2 -- packages/integration-shims/tsconfig.json | 2 -- packages/nextjs/tsconfig.json | 2 -- packages/nitro/tsconfig.json | 2 -- packages/node-native/tsconfig.json | 2 -- packages/nuxt/tsconfig.json | 2 -- packages/profiling-node/tsconfig.json | 2 -- packages/react-router/tsconfig.json | 2 -- packages/react/tsconfig.json | 2 -- packages/remix/tsconfig.json | 4 +--- packages/replay-canvas/tsconfig.json | 4 +--- packages/replay-internal/tsconfig.json | 4 +--- packages/replay-worker/tsconfig.json | 2 -- packages/solid/tsconfig.json | 4 +--- packages/solidstart/tsconfig.json | 5 +---- packages/sveltekit/tsconfig.json | 2 -- packages/tanstackstart-react/tsconfig.json | 5 +---- packages/typescript/tsconfig.json | 4 ++-- packages/vue/tsconfig.json | 2 -- 29 files changed, 8 insertions(+), 65 deletions(-) diff --git a/packages/astro/tsconfig.json b/packages/astro/tsconfig.json index 0b788fab5eae..bf45a09f2d71 100644 --- a/packages/astro/tsconfig.json +++ b/packages/astro/tsconfig.json @@ -4,8 +4,6 @@ "include": ["src/**/*"], "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler" // package-specific options } } diff --git a/packages/browser/tsconfig.json b/packages/browser/tsconfig.json index 6178eb6a0df8..b80e9ddbfaa5 100644 --- a/packages/browser/tsconfig.json +++ b/packages/browser/tsconfig.json @@ -4,8 +4,6 @@ "include": ["src/**/*", "test/loader.js"], "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", "lib": ["DOM", "es2020", "WebWorker"] } } diff --git a/packages/cloudflare/tsconfig.json b/packages/cloudflare/tsconfig.json index f5120ac13303..4c46d500eead 100644 --- a/packages/cloudflare/tsconfig.json +++ b/packages/cloudflare/tsconfig.json @@ -4,8 +4,6 @@ "include": ["src/**/*"], "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", "types": ["node", "@cloudflare/workers-types"] } } diff --git a/packages/core/tsconfig.types.json b/packages/core/tsconfig.types.json index de9b6935694a..65455f66bd75 100644 --- a/packages/core/tsconfig.types.json +++ b/packages/core/tsconfig.types.json @@ -2,8 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, diff --git a/packages/deno/tsconfig.build.json b/packages/deno/tsconfig.build.json index 87025d5676c5..c24f0659524b 100644 --- a/packages/deno/tsconfig.build.json +++ b/packages/deno/tsconfig.build.json @@ -4,7 +4,6 @@ "compilerOptions": { "outDir": "build", "lib": ["esnext"], - "module": "esnext", "target": "esnext", "declaration": true, "declarationMap": false diff --git a/packages/deno/tsconfig.json b/packages/deno/tsconfig.json index 83471a5dc7e7..1051fee686e1 100644 --- a/packages/deno/tsconfig.json +++ b/packages/deno/tsconfig.json @@ -3,8 +3,6 @@ "include": ["./lib.deno.d.ts", "src/**/*", "example.ts"], "compilerOptions": { "lib": ["esnext"], - "module": "esnext", - "moduleResolution": "bundler", "target": "esnext" } } diff --git a/packages/deno/tsconfig.test.json b/packages/deno/tsconfig.test.json index 548e94149758..1e7bdc859db5 100644 --- a/packages/deno/tsconfig.test.json +++ b/packages/deno/tsconfig.test.json @@ -3,7 +3,6 @@ "include": ["./lib.deno.d.ts", "test/**/*"], "compilerOptions": { "lib": ["esnext"], - "module": "esnext", "target": "esnext" } } diff --git a/packages/effect/tsconfig.json b/packages/effect/tsconfig.json index d49b053b37f8..3691d1bb14f6 100644 --- a/packages/effect/tsconfig.json +++ b/packages/effect/tsconfig.json @@ -1,8 +1,6 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", "outDir": "build" }, "include": ["src/**/*"] diff --git a/packages/ember/tsconfig.json b/packages/ember/tsconfig.json index 04eae83278b0..1f9068f3ba4a 100644 --- a/packages/ember/tsconfig.json +++ b/packages/ember/tsconfig.json @@ -4,7 +4,6 @@ "target": "es2022", "lib": ["DOM", "ES2022"], "allowJs": true, - "moduleResolution": "bundler", "allowSyntheticDefaultImports": true, "alwaysStrict": true, "strictNullChecks": true, @@ -12,7 +11,6 @@ "noEmitOnError": false, "noEmit": true, "baseUrl": ".", - "module": "esnext", "experimentalDecorators": true, "paths": { "dummy/tests/*": ["tests/*"], diff --git a/packages/feedback/tsconfig.json b/packages/feedback/tsconfig.json index 7e36a9efff44..1c951f0ee68e 100644 --- a/packages/feedback/tsconfig.json +++ b/packages/feedback/tsconfig.json @@ -1,9 +1,6 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", - /* Preact Config */ "jsx": "react-jsx", "jsxImportSource": "preact", diff --git a/packages/hono/tsconfig.json b/packages/hono/tsconfig.json index f5120ac13303..4c46d500eead 100644 --- a/packages/hono/tsconfig.json +++ b/packages/hono/tsconfig.json @@ -4,8 +4,6 @@ "include": ["src/**/*"], "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", "types": ["node", "@cloudflare/workers-types"] } } diff --git a/packages/integration-shims/tsconfig.json b/packages/integration-shims/tsconfig.json index 0b788fab5eae..bf45a09f2d71 100644 --- a/packages/integration-shims/tsconfig.json +++ b/packages/integration-shims/tsconfig.json @@ -4,8 +4,6 @@ "include": ["src/**/*"], "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler" // package-specific options } } diff --git a/packages/nextjs/tsconfig.json b/packages/nextjs/tsconfig.json index 202590772b10..bf45a09f2d71 100644 --- a/packages/nextjs/tsconfig.json +++ b/packages/nextjs/tsconfig.json @@ -5,7 +5,5 @@ "compilerOptions": { // package-specific options - "module": "esnext", - "moduleResolution": "bundler" } } diff --git a/packages/nitro/tsconfig.json b/packages/nitro/tsconfig.json index 202590772b10..bf45a09f2d71 100644 --- a/packages/nitro/tsconfig.json +++ b/packages/nitro/tsconfig.json @@ -5,7 +5,5 @@ "compilerOptions": { // package-specific options - "module": "esnext", - "moduleResolution": "bundler" } } diff --git a/packages/node-native/tsconfig.json b/packages/node-native/tsconfig.json index 2ddae9823070..087d3bdf1f07 100644 --- a/packages/node-native/tsconfig.json +++ b/packages/node-native/tsconfig.json @@ -1,8 +1,6 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", "outDir": "build", "types": ["node"] }, diff --git a/packages/nuxt/tsconfig.json b/packages/nuxt/tsconfig.json index 5766b891dd95..348a44427fdf 100644 --- a/packages/nuxt/tsconfig.json +++ b/packages/nuxt/tsconfig.json @@ -5,7 +5,5 @@ "compilerOptions": { // package-specific options - "module": "esnext", - "moduleResolution": "bundler" } } diff --git a/packages/profiling-node/tsconfig.json b/packages/profiling-node/tsconfig.json index 2ddae9823070..087d3bdf1f07 100644 --- a/packages/profiling-node/tsconfig.json +++ b/packages/profiling-node/tsconfig.json @@ -1,8 +1,6 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", "outDir": "build", "types": ["node"] }, diff --git a/packages/react-router/tsconfig.json b/packages/react-router/tsconfig.json index 2c276283f199..2845677dcc52 100644 --- a/packages/react-router/tsconfig.json +++ b/packages/react-router/tsconfig.json @@ -4,8 +4,6 @@ "include": ["src/**/*"], "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", "jsx": "react" } } diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json index 1b28c0b04eb9..41ff3c42258e 100644 --- a/packages/react/tsconfig.json +++ b/packages/react/tsconfig.json @@ -5,8 +5,6 @@ "compilerOptions": { "lib": ["DOM", "es2020"], - "module": "esnext", - "moduleResolution": "bundler", // package-specific options "esModuleInterop": true, "jsx": "react" diff --git a/packages/remix/tsconfig.json b/packages/remix/tsconfig.json index a1752fde9b92..2845677dcc52 100644 --- a/packages/remix/tsconfig.json +++ b/packages/remix/tsconfig.json @@ -4,8 +4,6 @@ "include": ["src/**/*"], "compilerOptions": { - "jsx": "react", - "module": "esnext", - "moduleResolution": "bundler" + "jsx": "react" } } diff --git a/packages/replay-canvas/tsconfig.json b/packages/replay-canvas/tsconfig.json index cf93e293f8ee..b9c0e3a032f4 100644 --- a/packages/replay-canvas/tsconfig.json +++ b/packages/replay-canvas/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "lib": ["DOM", "es2020"], - "module": "esnext", - "moduleResolution": "bundler" + "lib": ["DOM", "es2020"] }, "include": ["src/**/*.ts"] } diff --git a/packages/replay-internal/tsconfig.json b/packages/replay-internal/tsconfig.json index cf93e293f8ee..b9c0e3a032f4 100644 --- a/packages/replay-internal/tsconfig.json +++ b/packages/replay-internal/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "lib": ["DOM", "es2020"], - "module": "esnext", - "moduleResolution": "bundler" + "lib": ["DOM", "es2020"] }, "include": ["src/**/*.ts"] } diff --git a/packages/replay-worker/tsconfig.json b/packages/replay-worker/tsconfig.json index b043123c8140..bfa37b859232 100644 --- a/packages/replay-worker/tsconfig.json +++ b/packages/replay-worker/tsconfig.json @@ -1,8 +1,6 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", "lib": ["webworker", "scripthost"], "esModuleInterop": true, "target": "es2020", diff --git a/packages/solid/tsconfig.json b/packages/solid/tsconfig.json index ac10ca319f8f..82699cfe5ab5 100644 --- a/packages/solid/tsconfig.json +++ b/packages/solid/tsconfig.json @@ -4,11 +4,9 @@ "include": ["src/**/*"], "compilerOptions": { - "lib": ["DOM", "es2020"], + "lib": ["DOM", "es2020"] // This package imports ESM-only deps (`solid-js`); under `node16` resolution a CommonJS file // can't `require` those (TS1479/TS1541). Like our other framework packages it's compiled via a // bundler, so use `esnext`/`bundler` here instead of the `node16` default. - "module": "esnext", - "moduleResolution": "bundler" } } diff --git a/packages/solidstart/tsconfig.json b/packages/solidstart/tsconfig.json index 78a97ddc222b..b0eb9ecb6476 100644 --- a/packages/solidstart/tsconfig.json +++ b/packages/solidstart/tsconfig.json @@ -3,8 +3,5 @@ "include": ["src/**/*"], - "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler" - } + "compilerOptions": {} } diff --git a/packages/sveltekit/tsconfig.json b/packages/sveltekit/tsconfig.json index 0b788fab5eae..bf45a09f2d71 100644 --- a/packages/sveltekit/tsconfig.json +++ b/packages/sveltekit/tsconfig.json @@ -4,8 +4,6 @@ "include": ["src/**/*"], "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler" // package-specific options } } diff --git a/packages/tanstackstart-react/tsconfig.json b/packages/tanstackstart-react/tsconfig.json index c0a6a184ec03..9399ef75ead6 100644 --- a/packages/tanstackstart-react/tsconfig.json +++ b/packages/tanstackstart-react/tsconfig.json @@ -1,8 +1,5 @@ { "extends": "../../tsconfig.json", "include": ["src/**/*"], - "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler" - } + "compilerOptions": {} } diff --git a/packages/typescript/tsconfig.json b/packages/typescript/tsconfig.json index 0aaa8f81f87f..ea2154904764 100644 --- a/packages/typescript/tsconfig.json +++ b/packages/typescript/tsconfig.json @@ -7,8 +7,8 @@ "inlineSources": true, "isolatedModules": true, "lib": ["es2020"], - "module": "node16", - "moduleResolution": "node16", + "module": "esnext", + "moduleResolution": "bundler", "noErrorTruncation": true, "noFallthroughCasesInSwitch": true, "noImplicitReturns": true, diff --git a/packages/vue/tsconfig.json b/packages/vue/tsconfig.json index 9c9351f7b801..fd54f069790c 100644 --- a/packages/vue/tsconfig.json +++ b/packages/vue/tsconfig.json @@ -4,8 +4,6 @@ "include": ["src/**/*"], "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", "lib": ["DOM", "es2020"] } }