fix: circular import#319
Merged
Merged
Conversation
Contributor
|
I guess you are running in some sort of monorepo setup? Are you even supposed to run RN without the bundler setting? Does it not mess with metro? |
Contributor
Author
|
Yes, we have a monorepo setup, changing Looks like package.json exports confusing nodenext. I'm not sure. https://arethetypeswrong.github.io/?p=%40op-engineering%2Fop-sqlite%4015.0.3
Thanks for the amazing work btw. 💙 |
Contributor
|
Monorepo setups are too complicated, so they are not in my priority list. Feel free to submit PRs that fix the problem, as long as they don't clash with RN just functioning I will continue merging them. |
subtleGradient
pushed a commit
to effect-native/op-sqlite
that referenced
this pull request
Sep 12, 2025
fix: circular import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

When using TypeScript with
moduleResolution: "NodeNext"andmodule: "NodeNext", importing named exports from@op-engineering/op-sqlitev15 fails with:However, the same import works perfectly with
moduleResolution: "bundler"andmodule: "esnext".The issue stems from a circular dependency in the package's TypeScript definitions:
Why NodeNext Fails
TypeScript's
NodeNextmodule resolution uses stricter ESM semantics and has difficulty resolving re-exports when there are circular type dependencies. The module resolution algorithm fails to properly expose theopenfunction export due to this circular reference.Why Bundler Works
The
bundlermodule resolution mode is designed for modern bundlers that handle circular dependencies more gracefully. It resolves the re-exports in a way that successfully breaks the circular dependency cycle.related: #263 #308 #317