Marak / colors.js

get colors in your node.js console
https://github.com/Marak/colors.js
Other
5.17k stars 446 forks source link

Circular dependencies (prevents proper `rollup`) #233

Closed danielgindi closed 6 years ago

danielgindi commented 6 years ago

Rollup spits those out:

Circular dependency: node_modules\colors\lib\colors.js -> node_modules\colors\lib\maps\america.js -> node_modules\colors\lib\colors.js
Circular dependency: node_modules\colors\lib\colors.js -> node_modules\colors\lib\maps\america.js ->  commonjs-proxy:C:\Users\Daniel.SILVERBOLT\Desktop\git\endpoint-analyzer\node_modules\colors\lib\colors.js -> node_modules\colors\lib\colors.js
Circular dependency: node_modules\colors\lib\colors.js -> node_modules\colors\lib\maps\zebra.js -> node_modules\colors\lib\colors.js
Circular dependency: node_modules\colors\lib\colors.js -> node_modules\colors\lib\maps\rainbow.js -> node_modules\colors\lib\colors.js
Circular dependency: node_modules\colors\lib\colors.js -> node_modules\colors\lib\maps\random.js -> node_modules\colors\lib\colors.js

It is a huge problem, and will make code unexecutable after "rolling up". The rollup process will convert commonjs deps into "static imports", which do not support circular dependencies. Then it will end up with a flat hierarchy where there's a reference to a (yet) undefined variable.

DABH commented 6 years ago

This should be fixed in colors@1.3.1. Let us know if the issues persist. Thanks!

danielgindi commented 6 years ago

Amazing, thanks :-)