e115934061
Publish `@librechat/data-schemas` to NPM / pack (push) Failing after 8s
Publish `@librechat/client` to NPM / pack (push) Failing after 0s
GitNexus Index / index (push) Failing after 1s
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Has been skipped
Sync Helm Chart Tags / Sync chart tags (push) Failing after 2s
Publish `librechat-data-provider` to NPM / pack (push) Failing after 1s
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Failing after 1s
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Failing after 0s
Sync Helm Chart Tags / Ignore non-main push (push) Has been skipped
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Failing after 1s
Publish `@librechat/client` to NPM / publish-npm (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
GitNexus Index / post-index (push) Has been cancelled
Publish `@librechat/data-schemas` to NPM / publish-npm (push) Has been cancelled
25 lines
963 B
JavaScript
25 lines
963 B
JavaScript
/**
|
|
* `undici` (transitive dep of `@librechat/agents` and others) references
|
|
* `globalThis.File` from `node:buffer`. Node 20+ exposes it as a global;
|
|
* Node 18 / certain WSL toolchains do not, which surfaces as a
|
|
* `ReferenceError: File is not defined` at module-load time the first
|
|
* time a test imports `@librechat/agents`. Jest under those Node
|
|
* versions blows up before the suite can even start.
|
|
*
|
|
* Pull `File` from `node:buffer` (available since Node 18.x) and assign
|
|
* it onto `globalThis` if missing. Production code never depends on
|
|
* this — the polyfill only activates inside Jest.
|
|
*/
|
|
if (typeof globalThis.File === 'undefined') {
|
|
try {
|
|
const { File } = require('node:buffer');
|
|
if (File != null) {
|
|
globalThis.File = File;
|
|
}
|
|
} catch {
|
|
// Older Node versions without `node:buffer.File`. LibreChat doesn't
|
|
// support those anyway; let the test fail loudly rather than mask a
|
|
// real environment issue.
|
|
}
|
|
}
|