IronPDF NestJS TypeScript Build Errors
Adding the IronPDF Node.js SDK to a NestJS project causes TypeScript to fail at compile time:
Type '{ maxHeight?: number; htmlFragment?: string; ... }' is not assignable to type 'HtmlAffix'.Zod schema declarations inside the IronPDF SDK (affixSchema.ts, imageSchema.ts, pageSchema.ts) define types that do not match the expected object shapes in NestJS TypeScript builds. NestJS enforces stricter module resolution than a plain Node.js project, which surfaces these internal mismatches at compile time.
Solution
Run IronPdfEngine as a Docker container and configure the SDK to connect to it over HTTP. This removes the IronPDF SDK's Zod types from NestJS module resolution, stopping the build failures.
Start the IronPdfEngine container:
docker run -p 5000:33350 ironsoftwareofficial/ironpdfengine:2025.6.5docker run -p 5000:33350 ironsoftwareofficial/ironpdfengine:2025.6.5Configure IronPDF to use the container:
import { IronPdfGlobalConfig } from "@ironsoftware/ironpdf";
IronPdfGlobalConfig.getConfig().ironPdfEngineDockerAddress = "http://localhost:5000";Use IronPDF normally from a NestJS service:
import { PdfDocument } from "@ironsoftware/ironpdf";
const pdf = await PdfDocument.fromHtml("<h1>Hello PDF</h1>");
await pdf.saveAs("output.pdf");With the engine running in Docker, the NestJS application calls IronPdfEngine over HTTP. The SDK's internal Zod type declarations no longer participate in the TypeScript compilation.





