Skip to content

Commit 47ea41b

Browse files
committed
fix: build
1 parent 79cdd26 commit 47ea41b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

templates/node/src/client.ts.twig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ function getUserAgent() {
4848
// `navigator.userAgent` is available in Node.js 21 and later.
4949
// It's also part of the WinterCG spec, so many edge runtimes provide it.
5050
// https://common-min-api.proposal.wintercg.org/#requirements-for-navigatoruseragent
51+
// @ts-ignore
5152
if (typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string') {
53+
// @ts-ignore
5254
ua += ` ${navigator.userAgent}`;
5355

5456
// Older Node.js versions don't have `navigator.userAgent`, so we have to use `process.version`.
@@ -62,8 +64,6 @@ function getUserAgent() {
6264
class Client {
6365
static CHUNK_SIZE = 1024 * 1024 * 5;
6466

65-
fetch = nodeFetch;
66-
6767
config = {
6868
endpoint: '{{ spec.endpoint }}',
6969
selfSigned: false,
@@ -105,6 +105,7 @@ class Client {
105105
* @returns {this}
106106
*/
107107
setSelfSigned(selfSigned: boolean): this {
108+
// @ts-ignore
108109
if (typeof globalThis.EdgeRuntime !== 'undefined') {
109110
console.warn('setSelfSigned is not supported in edge runtimes.');
110111
}

templates/node/src/inputFile.ts.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { File } from "node-fetch-native";
1+
import { File } from "node-fetch-native-with-agent";
22
import { realpathSync, readFileSync } from "fs";
33
import type { BinaryLike } from "crypto";
44

0 commit comments

Comments
 (0)