mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-15 12:55:51 +00:00
fix: add markResourceTiming polyfill to performance shim for Node.js v22 undici compatibility
Node.js v22 undici internal calls performance.markResourceTiming() after every fetch. The performance shim was missing this method, causing TypeError crashes in ACP mode when running with Node.js.
This commit is contained in:
@@ -135,6 +135,9 @@ const shim = {
|
||||
clearResourceTimings: (() => {}) as typeof performance.clearResourceTimings,
|
||||
setResourceTimingBufferSize:
|
||||
(() => {}) as typeof performance.setResourceTimingBufferSize,
|
||||
// Node.js v22 undici internal calls this after every fetch — must exist to
|
||||
// avoid TypeError: markResourceTiming is not a function
|
||||
markResourceTiming: (() => {}) as any,
|
||||
// Delegate read-only properties to the original
|
||||
get timeOrigin() {
|
||||
return original.timeOrigin
|
||||
@@ -148,7 +151,7 @@ const shim = {
|
||||
toJSON() {
|
||||
return original.toJSON()
|
||||
},
|
||||
} as typeof performance
|
||||
} as unknown as typeof performance
|
||||
|
||||
/**
|
||||
* Install the shim onto globalThis.performance. Safe to call multiple times.
|
||||
|
||||
Reference in New Issue
Block a user