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
WARN Require cycle: node_modules/runtypes/lib/index.js -> node_modules/runtypes/lib/types/unknown.js -> node_modules/runtypes/lib/runtype.js -> node_modules/runtypes/lib/index.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
The text was updated successfully, but these errors were encountered:
Sorry, essentially it's not possible to remove the cycle. Each runtype such as Unknown needs to use the internal create function defined in runtype.ts, and the create function needs some of those runtypes in order to implement the utility functions like .optional() and .withConstraint(). Actually it might be possible if we put all the codebase in a single bloated file, but absolutely we don't want. I think bundlers have to be completely okay to work with circular imports.
It's a valid semantics in ECMAScript, however, we're currently transpiling only with "module": "commonjs" option. ESM support is definitely what we should add. Also, we can add some auxiliary configurations like "sideEffects": false in package.json, which would help bundlers to work.
Essentially this is a wontfix though, let's leave this issue open until the warning disappears after some configuration. Maybe #243 is also worth tracking.
Metro output:
The text was updated successfully, but these errors were encountered: