Skip to content

Commit e9862c0

Browse files
committed
try to fix esm with explicit file wrap
1 parent 0246624 commit e9862c0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/node/src/integrations/tracing/langgraph/instrumentation.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,26 @@ export class SentryLangGraphInstrumentation extends InstrumentationBase<LangGrap
6262
this._patch.bind(this),
6363
exports => exports,
6464
),
65+
new InstrumentationNodeModuleFile(
66+
/**
67+
* ESM builds use dist/prebuilt/index.js (without .cjs extension)
68+
* This catches ESM imports that resolve through the main package
69+
*/
70+
'@langchain/langgraph/dist/prebuilt/index.js',
71+
supportedVersions,
72+
this._patch.bind(this),
73+
exports => exports,
74+
),
6575
],
6676
);
77+
6778
return module;
6879
}
6980

7081
/**
7182
* Core patch logic applying instrumentation to the LangGraph module.
7283
*/
7384
private _patch(exports: PatchedModuleExports): PatchedModuleExports | void {
74-
console.log('patching LangGraph module');
7585
const client = getClient();
7686
const defaultPii = Boolean(client?.getOptions().sendDefaultPii);
7787

0 commit comments

Comments
 (0)