Albru
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 phx.new.web 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 phx.new.web 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.
First Post!
Albru
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 phx.new seem to create files with LF line endings, but when the mix phx.new.web task edited the existing configs, it used CRLF (inside LF configs) so the whole thing ended up being broken.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









