You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Metro Bundler Fails to Resolve Subpath Exports from platejs and @platejs/core in React Native/Expo #4457
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.
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
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"
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.
Activity
dosubot commentedon Jul 3, 2025
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/reactor@platejs/core/reactfail 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
