From 098dfdf47af9830727ccfa7726145f8b47225010 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Fri, 10 Jul 2026 12:52:48 +0100 Subject: [PATCH 1/3] test: Turbo pack --- packages/server-utils/src/orchestrion/bundler/webpack.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/server-utils/src/orchestrion/bundler/webpack.ts b/packages/server-utils/src/orchestrion/bundler/webpack.ts index 04eb56a2c6b9..46bc425a79e3 100644 --- a/packages/server-utils/src/orchestrion/bundler/webpack.ts +++ b/packages/server-utils/src/orchestrion/bundler/webpack.ts @@ -5,6 +5,7 @@ import { createRequire } from 'node:module'; import { dirname } from 'node:path'; import type { InstrumentationConfig } from '@apm-js-collab/code-transformer'; import { SENTRY_INSTRUMENTATIONS } from '../config'; +import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/vite'; // Both branches use `createRequire` (never alias the CJS `require`) so bundlers consuming this // module don't emit a "Critical dependency" warning. @@ -46,10 +47,6 @@ export function getSentryInstrumentations(): InstrumentationConfig[] { * does NOT inject the `__SENTRY_ORCHESTRION__.bundler` marker — that would disable the runtime * module hook, which externalized packages still need (hybrid setup). */ -export function sentryOrchestrionWebpackPlugin(): unknown { - const mod = getOrchestrionRequire()('@apm-js-collab/code-transformer-bundler-plugins/webpack') as { - default?: (options: { instrumentations: InstrumentationConfig[] }) => unknown; - }; - const codeTransformerWebpack = mod.default ?? (mod as unknown as NonNullable); - return codeTransformerWebpack({ instrumentations: SENTRY_INSTRUMENTATIONS }); +export function sentryOrchestrionWebpackPlugin(): ReturnType { + return codeTransformer({ instrumentations: SENTRY_INSTRUMENTATIONS }); } From b4bec6ec5ca7d9b2871ecdef73ca63d4829c0d27 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Fri, 10 Jul 2026 14:42:45 +0100 Subject: [PATCH 2/3] get past the build --- packages/nextjs/src/config/webpack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index 94db1cca621d..30532b354360 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -433,7 +433,7 @@ export function constructWebpackConfigFunction({ // Orchestrion code-transform loader — Node server runtime only, never the edge compilation if (runtime === 'server' && userSentryOptions._experimental?.useDiagnosticsChannelInjection) { - newConfig.plugins.push(sentryOrchestrionWebpackPlugin() as WebpackPluginInstance); + newConfig.plugins.push(sentryOrchestrionWebpackPlugin() as unknown as WebpackPluginInstance); } return newConfig; From 08b42197376caee0b3912d8c40a00ff0a9a6c5df Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Fri, 10 Jul 2026 16:34:48 +0100 Subject: [PATCH 3/3] more --- packages/server-utils/package.json | 5 ++--- packages/server-utils/src/orchestrion/bundler/webpack.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/server-utils/package.json b/packages/server-utils/package.json index 749dd600cb80..cd0ba30a9c90 100644 --- a/packages/server-utils/package.json +++ b/packages/server-utils/package.json @@ -39,12 +39,11 @@ }, "./orchestrion/vite": { "types": "./build/types/orchestrion/bundler/vite.d.ts", - "import": "./build/esm/orchestrion/bundler/vite.js" + "default": "./build/esm/orchestrion/bundler/vite.js" }, "./orchestrion/webpack": { "types": "./build/types/orchestrion/bundler/webpack.d.ts", - "import": "./build/esm/orchestrion/bundler/webpack.js", - "require": "./build/cjs/orchestrion/bundler/webpack.js" + "default": "./build/esm/orchestrion/bundler/webpack.js" }, "./orchestrion/import-hook": { "import": "./build/orchestrion/import-hook.mjs" diff --git a/packages/server-utils/src/orchestrion/bundler/webpack.ts b/packages/server-utils/src/orchestrion/bundler/webpack.ts index 46bc425a79e3..860a1cc046bc 100644 --- a/packages/server-utils/src/orchestrion/bundler/webpack.ts +++ b/packages/server-utils/src/orchestrion/bundler/webpack.ts @@ -5,7 +5,7 @@ import { createRequire } from 'node:module'; import { dirname } from 'node:path'; import type { InstrumentationConfig } from '@apm-js-collab/code-transformer'; import { SENTRY_INSTRUMENTATIONS } from '../config'; -import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/vite'; +import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/webpack'; // Both branches use `createRequire` (never alias the CJS `require`) so bundlers consuming this // module don't emit a "Critical dependency" warning.