justinmimbs / elm-module-graph

Visually explore package and module dependencies for an Elm project
https://justinmimbs.github.io/elm-module-graph
32 stars 3 forks source link

cyclical dependency involving third party package #3

Closed mordrax closed 7 years ago

mordrax commented 7 years ago

Our project compiles using elm-make fine, however, elm-module-graph complains there is a cycle:

image

This goes on for 3000+ and it all has the FormatNumber module in the middle of it.

edit: I've tried to replicate it without success by doing:

  1. Creating two files with cyclical dependency but not importing them in the elm make.
  2. Adding the FormatNumber library to another project and importing it the same way:
    import FormatNumber
    import FormatNumber.Locales exposing (Locale, usLocale)
justinmimbs commented 7 years ago

My guess is that your project has a module named Helpers? The elm-format-number package contains an unexposed module called Helpers, and my script follows unexposed package modules too. I'll update the script stop including unexposed modules....

mordrax commented 7 years ago

That makes alot of sense, let me try renaming it and see if it works, will update this issue.

mordrax commented 7 years ago

@justinmimbs Thanks, that was the problem.

And I've just 'discovered' what was causing our dependency issue from looking at the graph. It makes it soooo easy!

justinmimbs commented 7 years ago

Right on. :) The script still has the issue of including unexposed package modules in a global namespace, which can cause a conflict when it shouldn't need to (like your Helpers and elm-format-number's internal Helpers). So I'm going to re-open this until I can fix that. Thanks for your reports!