kysely icon indicating copy to clipboard operation
kysely copied to clipboard

React Native should use CJS

Open goknsh opened this issue 6 months ago • 4 comments
trafficstars

Without this, builds in Expo 53 break (expo/expo#36544) because the package.json:exports field is now enabled by default in Metro bundler.

This causes the ESM version of Kysely to get imported, which is an issue because Metro can't do dynamic imports yet (facebook/metro#52) which is used in the FileMigrationProvider: https://github.com/kysely-org/kysely/blob/master/src/migration/file-migration-provider.ts#L38-L43

This is a quick fix, but IMO the FileMigrationProvider should get its own sub path in package.json:exports so that RN can use the ESM version as well. If that's more acceptable even though it would be a breaking change, let me know and I can update the PR.

goknsh avatar May 02 '25 00:05 goknsh

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 2, 2025 0:46am

vercel[bot] avatar May 02 '25 00:05 vercel[bot]

kysely_koa_example

npm i https://pkg.pr.new/kysely-org/kysely@1452

commit: c7a89a5

pkg-pr-new[bot] avatar May 02 '25 01:05 pkg-pr-new[bot]

Hey 👋

Thanks! 🙏

Relevant thread: https://github.com/expo/expo/discussions/36551#discussioncomment-13009957

igalklebanov avatar May 02 '25 23:05 igalklebanov

Curious if there was any progress or plans to get this out? Thanks!

jar145 avatar May 06 '25 23:05 jar145