Files
OmniRoute/open-sse/executors/codex/wreqLoader.ts
Diego Rodrigues de Sa e Souza 8939ccbae3 fix(sse): dynamic-specifier require for wreq-js in Codex WS transport (#12491) (#13756)
Merged in the 2026-09-16 sweep of the maintainer's own open PRs, at the owner's explicit instruction. No push was made to the PR branch: the merge took the head as the owning session left it (verified OPEN, non-draft and MERGEABLE against the release tip immediately before merging).
2026-09-16 06:17:57 -03:00

10 lines
579 B
TypeScript

// #12491 — keep the module-name argument dynamic (never a literal string)
// when calling a createRequire()-returned function. Turbopack statically
// detects a literal specifier and rewrites the call to a hashed require()
// target that resolves only via a `.next`-relative symlink generated at
// build time, which is absent from the standalone Docker runtime. Mirrors
// open-sse/utils/tlsClient.ts's loadRuntimeModule().
export function loadDynamicModule(requireFn: NodeRequire, moduleName: string): unknown {
return Reflect.apply(requireFn, undefined, [moduleName]);
}