Skip to content

Metro Bundler Fails to Resolve Subpath Exports from platejs and @platejs/core in React Native/Expo #4457

Closed

Description

@guillempuche

Description

Metro bundler (used by Expo/React Native) fails to resolve subpath exports from platejs and @platejs/core packages. When importing from @platejs/basic-nodes, platejs/react or @platejs/core/react, Metro throws "Unable to resolve" errors. This prevents using Plate in React Native/Expo applications.

Image

Reproduction URL

https://github.com/guillempuche/workspace

Reproduction steps

1. Clone the repository: `git clone https://github.com/guillempuche/workspace`
2. Install dependencies: `yarn install`
3. Run the Expo web app: `yarn workspace @workspace/apps-expo web`
4. See error: `Unable to resolve "platejs/react" from "apps/expo/src/app/editor.tsx"`

Plate version

49.0.19

Slate React version

0.117.1

Screenshots

Image

Logs

Web Bundling failed 6188ms apps/expo/index.ts (1225 modules)
Unable to resolve "platejs/react" from "apps/expo/src/app/editor.tsx"


When trying to import from `@platejs/core/react` after installing it directly:

Web Bundling failed 6328ms apps/expo/index.ts (1225 modules)
Unable to resolve "@platejs/core/react" from "apps/expo/src/app/editor.tsx"

Browsers

Firefox

Activity

  1. dosubot commented on Jul 3, 2025

    @dosubot

    Hi @guillempuche! I'm Dosu and I’m helping the plate team.

    Metro (used by Expo/React Native) doesn't support the package.json "exports" field or subpath exports, which is why imports like platejs/react or @platejs/core/react fail with "Unable to resolve" errors. Plate defines these subpath exports using the "exports" field for modern bundlers, but Metro ignores this and looks for physical files or folders that don't exist, causing the error you see cite.

    There isn't official support or a documented workaround for using Plate with Metro/Expo. To work around this, you could try importing directly from the built file paths (like platejs/dist/react/index.js), but this is brittle and not guaranteed to work. Other options are forking the package to flatten the exports or using a custom Metro resolver, but both require extra setup.

    Right now, Metro's lack of support for subpath exports is a fundamental blocker for using Plate in React Native/Expo projects.

    To reply, just mention @dosu.


    How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

  2. locked and limited conversation to collaborators on Jul 3, 2025
  3. converted this issue into a discussion #4458 on Jul 3, 2025
  4. added theissue type on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions