Skip to content

Commit df416cc

Browse files
committed
fix(agiloft): remove import type from .server module to fix client bundle build
Turbopack resolves .server.ts modules even for type-only imports, pulling dns/promises into client bundles. Define SecureFetchResponse locally instead.
1 parent a05b442 commit df416cc

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

apps/sim/tools/agiloft/utils.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { createLogger } from '@sim/logger'
2-
import type { SecureFetchResponse } from '@/lib/core/security/input-validation.server'
32
import type {
43
AgiloftAttachmentInfoParams,
54
AgiloftBaseParams,
@@ -14,6 +13,21 @@ import type {
1413
} from '@/tools/agiloft/types'
1514
import type { HttpMethod, ToolResponse } from '@/tools/types'
1615

16+
/**
17+
* Mirrors the shape of SecureFetchResponse from input-validation.server.ts.
18+
* Defined locally to avoid importing the .server module into client bundles
19+
* (it pulls in dns/promises which is Node-only).
20+
*/
21+
interface SecureFetchResponse {
22+
ok: boolean
23+
status: number
24+
statusText: string
25+
headers: { get(name: string): string | null }
26+
text: () => Promise<string>
27+
json: () => Promise<unknown>
28+
arrayBuffer: () => Promise<ArrayBuffer>
29+
}
30+
1731
const logger = createLogger('AgiloftAuth')
1832

1933
/**

0 commit comments

Comments
 (0)