Skip to content

Injection silently no-ops on Windows (registerHooks path) #24695

Description

@timfish

Summary

On Windows with Node >= 24.13 (the sync Module.registerHooks() path), registerDiagnosticsChannelInjection from @sentry/server-runtime-injection instruments nothing. Modules load uninstrumented and no spans are produced. No warning is emitted. Linux and macOS are unaffected.

Root cause

The vendored @apm-js-collab/tracing-hooks resolve hook passes a file:// URL to module-details-from-path, which splits on path.sep (\ on Windows) and so never finds node_modules, returning undefined. No transformer gets registered. On the async Module.register() path the failure is masked by the separate Module.prototype._compile CJS patch; the sync path has no such fallback, so it breaks outright.

Fix belongs upstream in apm-js-collab/tracing-hooks (fileURLToPath(url.url) before module-details-from-path), then re-vendored into @sentry/server-runtime-injection.

Environment

  • @sentry/node / @sentry/server-runtime-injection 11.0.0 (@apm-js-collab/tracing-hooks 0.13.2)
  • Windows, Node 24.13+
  • Found via @sentry/electron e2e (Electron 40–44); a plain Node 24 + Windows app requiring any instrumented package reproduces it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions