Run the orchestrion code transform on browser modules, through the asset server's loader chain, so client side instrumentation works without a bundler.
- Add a loader that applies the transform to modules under
node_modules, resolving the package name and version from the file path.
- Point orchestrion's
dcModule at our browser diagnostics_channel shim.
- Patch
run in @remix-run/ui so component render errors are captured with no application code.
This is the only compile time hook in the Remix 3 client pipeline. It also matters for remix/spa, where the same fetch-router runs in the browser and the Node module hook can never reach it.
Three things have to line up, and each one fails differently:
- The shim must implement the low level channel API the injected code calls:
ch.start.runStores, ch.error.publish, ch.end.publish. The traceSync helpers are not what it uses.
ModuleType must be lower case esm. Anything else silently emits a CommonJS require, which the asset server cannot serve.
- The shim is referenced by public URL and must be in
scripts.external, percent encoded exactly as the asset server encodes its own rewrites. A bare specifier does not resolve under pnpm. A mismatch loads two copies of the shim, giving two subscriber registries and no instrumentation, with no error anywhere.
Done when e2e confirms the transform is applied to a served browser module, the injected channel fires in the browser, and a component render error reaches Sentry with mechanism auto.ui.remix_v3.
Run the orchestrion code transform on browser modules, through the asset server's loader chain, so client side instrumentation works without a bundler.
node_modules, resolving the package name and version from the file path.dcModuleat our browserdiagnostics_channelshim.runin@remix-run/uiso component render errors are captured with no application code.This is the only compile time hook in the Remix 3 client pipeline. It also matters for
remix/spa, where the same fetch-router runs in the browser and the Node module hook can never reach it.Three things have to line up, and each one fails differently:
ch.start.runStores,ch.error.publish,ch.end.publish. ThetraceSynchelpers are not what it uses.ModuleTypemust be lower caseesm. Anything else silently emits a CommonJSrequire, which the asset server cannot serve.scripts.external, percent encoded exactly as the asset server encodes its own rewrites. A bare specifier does not resolve under pnpm. A mismatch loads two copies of the shim, giving two subscriber registries and no instrumentation, with no error anywhere.Done when e2e confirms the transform is applied to a served browser module, the injected channel fires in the browser, and a component render error reaches Sentry with mechanism
auto.ui.remix_v3.