IRONSOFTWAREHOME

verbatimModuleSyntax Errors in IronPDF for Node.js

Curtis Chau
Curtis Chau
Updated: June 19, 2026

When you use IronPDF for Node.js in a TypeScript project, the verbatimModuleSyntax compiler option controls how import and export statements are emitted, and it can cause build errors when it conflicts with your module system.

How the option behaves

Set to false (the common choice): TypeScript rewrites import and export statements to match the target module system. With a CommonJS target it converts ESM-style imports (import ... from '...') into require() calls; with an ESNext target it keeps the ESM syntax.

Set to true: TypeScript preserves the import and export syntax exactly as written. ESM syntax stays ESM regardless of the target, which fails when the module system does not support it.

Errors when it is enabled

With "verbatimModuleSyntax": true, a CommonJS build can fail with:

A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled.
Text
ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.
Text

The first happens because CommonJS does not support a top-level export; the second happens when ESM syntax is left untransformed for a CommonJS module.

Recommendation

For most projects, keep the option disabled so TypeScript adjusts the module syntax for you:

{
  "compilerOptions": {
    "verbatimModuleSyntax": false
  }
}
JSON

If you need strict syntax preservation for a specific bundler or environment, set it to true only when your module system fully supports the syntax your source uses.

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 Iron Suite
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