IRONSOFTWAREHOME

IronPDF NestJS TypeScript Build Errors

Curtis Chau
Curtis Chau
Updated: June 10, 2026

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'.
Text

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.5
SHELL

Configure IronPDF to use the container:

import { IronPdfGlobalConfig } from "@ironsoftware/ironpdf";

IronPdfGlobalConfig.getConfig().ironPdfEngineDockerAddress = "http://localhost:5000";
TypeScript

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");
TypeScript

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.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Version:2026.8just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
Node.js Module Download for PDF
Install with npm

Version: 2026.8

  1. Download and install Node.js 12+.
  2. Execute the above command in the terminal.

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

OR
bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required
Node.js Module Download for PDF
Install with npm

Version: 2026.8

  1. Download and install Node.js 12+.
  2. Execute the above command in the terminal.

Licenses from $999