realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

Bundling with Metro warns with "Require cycles are allowed, but can result in uninitialized values."

Open kraenhansen opened this issue 1 year ago • 2 comments

We used to resolve these require cycles as part of producing a rollup bundle, but these will now surface as warnings when bundling with Metro.

We could probably revisit the decision to use a internal.ts to control the import order and instead focus on breaking the cycles:

https://github.com/realm/realm-js/blob/1e1e48a0f906d471b4a046168ed8cd628ef2d70f/packages/realm/src/internal.ts#L21

kraenhansen avatar Mar 19 '24 21:03 kraenhansen

➤ PM Bot commented:

Jira ticket: RJS-2769

sync-by-unito[bot] avatar Mar 19 '24 21:03 sync-by-unito[bot]

This might be an interesting eslint plugin to resolve this and prevent regressions: https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md

kraenhansen avatar Jun 28 '24 14:06 kraenhansen