Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/nervous-pianos-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@portabletext/react-pdf": major
---

The package is now ESM only, and requires Node.js 22.12 or later

#### When you will see a difference

Only if you load this package with `require()`, or build on Node.js 20 or earlier. If you already `import` it, nothing changes.

#### What changes

The package no longer ships a CommonJS build. `require("@portabletext/react-pdf")` will fail, where before it resolved to `dist/index.cjs`. Use `import` instead, or a dynamic `await import()` from a CommonJS file.

This brings the package in line with the rest of the Portable Text packages, which are already ESM only.

Node.js 20 reached end of life in April 2026. The package previously declared no `engines` range at all, so nothing was enforced.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@
".": {
"source": "./src/index.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist",
Expand Down Expand Up @@ -97,6 +95,9 @@
"vite": "^7.1.3",
"vitest": "^3.2.4"
},
"engines": {
"node": ">=22.12"
},
"packageManager": "pnpm@10.11.1",
"publishConfig": {
"access": "public"
Expand Down
Loading