question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Require cycles warnings

See original GitHub issue

With react-native 0.57.8 and latest metro bundler 0.48.5, I get these warnings on the console:

12-17 00:30:03.554  4570  4620 W ReactNativeJS: Require cycle: node_modules/libphonenumber-js/build/common.js -> node_modules/libphonenumber-js/build/IDD.js -> node_modules/libphonenumber-js/build/common.js
12-17 00:30:03.554  4570  4620 W ReactNativeJS:
12-17 00:30:03.554  4570  4620 W ReactNativeJS: Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
12-17 00:30:03.554  4570  4620 W ReactNativeJS: Require cycle: node_modules/libphonenumber-js/build/common.js -> node_modules/libphonenumber-js/build/parseIncompletePhoneNumber.js -> node_modules/libphonenumber-js/build/common.js
12-17 00:30:03.554  4570  4620 W ReactNativeJS:
12-17 00:30:03.554  4570  4620 W ReactNativeJS: Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
12-17 00:30:03.554  4570  4620 W ReactNativeJS: Require cycle: node_modules/libphonenumber-js/build/getNumberType.js -> node_modules/libphonenumber-js/build/parse.js -> node_modules/libphonenumber-js/build/getNumberType.js
12-17 00:30:03.554  4570  4620 W ReactNativeJS:
12-17 00:30:03.554  4570  4620 W ReactNativeJS: Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
12-17 00:30:03.554  4570  4620 W ReactNativeJS: Require cycle: node_modules/libphonenumber-js/build/isPossibleNumber.js -> node_modules/libphonenumber-js/build/getNumberType.js -> node_modules/libphonenumber-js/build/parse.js -> node_modules/libphonenumber-js/build/isPossibleNumber.js
12-17 00:30:03.554  4570  4620 W ReactNativeJS:
12-17 00:30:03.554  4570  4620 W ReactNativeJS: Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
12-17 00:30:03.555  4570  4620 W ReactNativeJS: Require cycle: node_modules/libphonenumber-js/build/parse.js -> node_modules/libphonenumber-js/build/RFC3966.js -> node_modules/libphonenumber-js/build/parse.js
12-17 00:30:03.555  4570  4620 W ReactNativeJS:
12-17 00:30:03.555  4570  4620 W ReactNativeJS: Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
12-17 00:30:03.555  4570  4620 W ReactNativeJS: Require cycle: node_modules/libphonenumber-js/build/PhoneNumber.js -> node_modules/libphonenumber-js/build/isPossibleNumber.js -> node_modules/libphonenumber-js/build/getNumberType.js -> node_modules/libphonenumber-js/build/parse.js -> node_modules/libphonenumber-js/build/PhoneNumber.js
12-17 00:30:03.555  4570  4620 W ReactNativeJS:
12-17 00:30:03.555  4570  4620 W ReactNativeJS: Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.

Can these warnings be avoided with some refactoring of the imports?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
thomasleduccommented, Apr 7, 2020

I currently use the libphonenumber-js@1.7.50, and I still got the error :

../../node_modules/libphonenumber-js/es6/common.js -> ../../node_modules/libphonenumber-js/es6/IDD.js -> ../../node_modules/libphonenumber-js/es6/common.js
../../node_modules/libphonenumber-js/es6/common.js -> ../../node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js -> ../../node_modules/libphonenumber-js/es6/common.js
../../node_modules/libphonenumber-js/es6/getNumberType.js -> ../../node_modules/libphonenumber-js/es6/parse.js -> ../../node_modules/libphonenumber-js/es6/getNumberType.js
...and 3 more

And I don’t use react native.

@catamphetamine How did you stop that in version 7 ?

0reactions
catamphetaminecommented, Apr 7, 2020

@thomasleduc Seems to be the latest one. No common.js: https://unpkg.com/browse/libphonenumber-js@1.7.50/es6/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Require cycles are allowed, but can result in uninitialized ...
js This is what triggers the Require cycle warning because a module that was imported from one place, is then rendering and asking...
Read more >
Require Cycle Warning on 13.6.0 #1922 - GitHub
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle. ... Require cycles are ......
Read more >
Require Cycle Warnings : r/reactnative - Reddit
I like using the index.js to export a bunch of components I designed and it keeps giving me Require Cycle Warning /components --Comp1.js…...
Read more >
Prevent Require Cycle warnings on terminal-React Native
Prevent Require Cycle warnings on terminal · Require cycles are allowed, but can result in uninitialized values. · Require cycle while requiring store...
Read more >
Realm node package has "cycle" warnings - MongoDB
Chrome debugger outputs the following warning that appears to cause circular references and possible memory leaks. Require cycle: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found