Plate
PlateEditorsTemplates
GitHub16kGitHub
DiscordDiscord
  • Feature Kits
  • Plugin
    • Plugin Methods
    • Plugin Shortcuts
    • Plugin Context
    • Plugin Components
    • Plugin Rules
    • Editing Behavior
    • Plugin Input Rules
  • Editor
    • Editor Methods
    • Controlled Value
  • Authored Changes
  • Performance
  • Static Rendering
  • HTML
  • Markdown
  • Form
  • TypeScript
  • Debugging
  • Unit Testing
  • Browser
  • Troubleshooting
  • Locations
  • Transactions
  • Serializing
  • Roots
  • Document Meta
  • Clipboard and Paste
  • Decorations, annotations, and widgets
  • Schema
  • History
  • Pagination
  • Annotations
  • DOM Coverage
  • External Text Views
  • Virtualized Rendering

TypeScript

PreviousNext

Resolve Plate public entrypoints in bundled apps and Node.js projects.

Plate publishes ESM entrypoints with an exports map. Configure TypeScript to read that map so imports such as platejs/react resolve to the matching declarations and runtime files.

Bundled apps

For Vite, Next.js, and other bundlers, use moduleResolution: "bundler" with an ESM module target:

tsconfig.json
{
  "compilerOptions": {
    "module": "ESNext",
    "moduleResolution": "bundler",
    "jsx": "preserve",
    "strict": 


FormDebugging

On This Page

Bundled appsNode.js projectsPublic importsDiagnose resolution errors
Build your editor
Production-ready AI template and reusable components.
Get all-access
true
,
"noEmit": true
}
}
tsconfig.json
{
  "compilerOptions": {
    "module": "ESNext",
    "moduleResolution": "bundler",
    "jsx": "preserve",
    "strict": true,
    "noEmit": true
  }
}

Keep the other settings supplied by your framework. The bundler resolution mode requires TypeScript 5.0 or later.

Node.js projects

For code executed directly by Node.js, pair NodeNext module resolution with the same module setting:

tsconfig.json
{
  "compilerOptions": {
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "strict": true
  }
}
tsconfig.json
{
  "compilerOptions": {
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "strict": true
  }
}

Declare "type": "module" in your application's package.json when emitting ESM from .ts files. Follow the Node.js guide for server-safe Plate imports.

Public imports

Import from the published entrypoint:

import { createEditor } from 'platejs';
import { createEditor } from 'platejs';

Use platejs/react for editable React APIs and platejs/static for static React rendering. Import feature subpaths only when the installed package exports them.

Keep application aliases such as @/* in your framework configuration. Do not alias Plate imports to node_modules/platejs/dist: the export map owns the relationship between a public subpath and its files, and those paths do not all share the same directory layout.

Diagnose resolution errors

  • Package not found: confirm that platejs is installed in the workspace that imports it and that TypeScript uses the intended config.
  • Subpath not found: check the installed package's exports map and use bundler or NodeNext resolution.
  • No exported member: check the identifier, entrypoint, and installed version. A path alias cannot add a missing export.
  • Only tests fail: configure the test runner for ESM and package exports as well as TypeScript. Avoid a second set of aliases into package internals.

Use the troubleshooting guide to inspect installed versions and runtime duplication.