New umbrella web - `Could not find "import Config"`

Hi, I have an existing umbrella application that was created about 3 months ago.
Since I use mix release, I switched from use Mix.Config to import Config in all of my config files. Today I wanted to create another web inside the umbrella, so I went inside the apps folder and ran mix new_web, but I got the following error:

** (Mix) Could not find "use Mix.Config" or "import Config" in "c:/git/web_umbrella/config/config.exs"

However my config.exs as well as the other sub-configs have the import Config line present.

To test things out I created another umbrella, replaced all the use Mix.Config lines with import Config and ran mix just like in the other project and it created the web just fine.

Does anybody have an idea what might be wrong with my project? Is there a way to debug the task so I can see what’s going on?

I’m currently on Elixir v1.10.2.

Figured out that this is because of the config files having CRLF line endings on Windows, while the Mix task is matching against “import Config\n”. I guess I should create an issue on the Phoenix repo, however it is not clear to me what would the correct line endings be. mix seem to create files with LF line endings, but when the mix task edited the existing configs, it used CRLF (inside LF configs) so the whole thing ended up being broken.

If you use git you can save yourself some trouble by making it convert to the UNIX style newlines.

I did that the moment I found out about the issue, but that’s still not quite enough. The file now has Unix-style line endings, so it is parsed successfully and the task runs, but Mix still uses Windows-style line endings when writing to it, so the altered config file has both Unix-style and Windows-style line endings.

Are you sure it’s mix that’s doing it and not your editor? Hm, really weird.