Fl4m3Ph03n1x

Fl4m3Ph03n1x

Background

I have an umbrella app and I am trying to add a phoenix app inside of it. However, When I run the mix command to create a phoenix umbrella app, I get an error I don’t understand.

Problem

I have an umbrella app with the following structure:

market_manager
  |_apps
    |_ app1
    |_ app2

I want to add another umbrella app to my apps folder, a phx_test_app.
To do so I am running mix phx.new.web phx_test --live --no-ecto inside of my apps folder. However I get the following error:

λ mix phx.new.web test --no-ecto
** (Mix) Could not find "use Mix.Config" or "import Config" in "c:/Users/palme/Documents/GitHub/market_manager/config/config.exs"

To me this is confusing, as this is contents of the file in question:

import Config

import_config "#{Mix.env()}.exs"

So I definitely have the one thing the error says I am missing.

Questions

Why am I having this error and how can I fix it?

For those of you curious enough, this is the project in question:
https://github.com/Fl4m3Ph03n1x/market_manager/tree/dev

Showing Posts 1 to 10

LostKobrakai

LostKobrakai

Try updating phx.new. I had no problem running your command on the cloned repo on both master and dev branch.

Fl4m3Ph03n1x

Fl4m3Ph03n1x OP

How do I do that ?

LostKobrakai

LostKobrakai

mix archive.install hex phx_new 1.5.9
Fl4m3Ph03n1x

Fl4m3Ph03n1x OP

Even after updating, it still fails.
I have also deleted my project and cloned it from zero again in hopes it would fix the issue, but alas, I was not that lucky:

λ mix archive.install hex phx_new 1.5.9
Resolving Hex dependencies...
Dependency resolution completed:
New:
  phx_new 1.5.9
* Getting phx_new (Hex package)
All dependencies are up to date
Compiling 10 files (.ex)
Generated phx_new app
Generated archive "phx_new-1.5.9.ez" with MIX_ENV=prod
Found existing entry: c:/Users/palme/.mix/archives/phx_new-1.5.9
Are you sure you want to replace it with "phx_new-1.5.9.ez"? [Yn] Y
* creating c:/Users/palme/.mix/archives/phx_new-1.5.9

C:\Users\palme\Documents\GitHub\market_manager\apps (dev -> origin)
λ mix phx.new.web phx_test --live --no-ecto
** (Mix) Could not find "use Mix.Config" or "import Config" in "c:/Users/palme/Documents/GitHub/market_manager/config/config.exs"
kokolegorille

kokolegorille

Try to remove the old installer before adding the new one…

You get the list with

mix archive

You remove with

mix archive.uninstall ...

Then install the new one.

Fl4m3Ph03n1x

Fl4m3Ph03n1x OP

Still failing:

λ mix archive
* hex-0.21.2
* phx_new-1.5.9
Archives installed at: c:/Users/palme/.mix/archives

GitHub\market_manager\apps (dev -> origin)
λ mix archive.uninstall phx_new 1.5.9
Are you sure you want to uninstall c:/Users/palme/.mix/archives/phx_new-1.5.9? [Yn] Y

GitHub\market_manager\apps (dev -> origin)
λ mix archive
* hex-0.21.2
Archives installed at: c:/Users/palme/.mix/archives

GitHub\market_manager\apps (dev -> origin)
λ mix archive.install hex phx_new 1.5.9
Resolving Hex dependencies...
Dependency resolution completed:
New:
  phx_new 1.5.9
* Getting phx_new (Hex package)
All dependencies are up to date
Compiling 10 files (.ex)
Generated phx_new app
Generated archive "phx_new-1.5.9.ez" with MIX_ENV=prod
Are you sure you want to install "phx_new-1.5.9.ez"? [Yn] Y
* creating c:/Users/palme/.mix/archives/phx_new-1.5.9

GitHub\market_manager\apps (dev -> origin)
λ mix phx.new.web phx_test --live --no-ecto
** (Mix) Could not find "use Mix.Config" or "import Config" in "c:/Users/palme/Documents/GitHub/market_manager/config/config.exs"

Could it be because I am using Windows?

kokolegorille

kokolegorille

It works on my Linux machine with same versions…

$ mix new koko --umbrella
* creating README.md
* creating .formatter.exs
* creating .gitignore
* creating mix.exs
* creating apps
* creating config
* creating config/config.exs

Your umbrella project was created successfully.
Inside your project, you will find an apps/ directory
where you can create and host many apps:

    cd koko
    cd apps
    mix new my_app

Commands like "mix compile" and "mix test" when executed
in the umbrella project root will automatically run
for each application in the apps/ directory.
$ cd koko/apps/
$ mix phx.new.web test --no-ecto --live
* creating test/lib/test.ex
* creating test/lib/test/application.ex
* creating test/lib/test/channels/user_socket.ex
* creating test/lib/test/endpoint.ex
* creating test/lib/test/router.ex
* creating test/lib/test/telemetry.ex
* creating test/lib/test/views/error_helpers.ex
* creating test/lib/test/views/error_view.ex
* creating test/mix.exs
* creating test/README.md
* creating test/.gitignore
* creating test/test/test_helper.exs
* creating test/test/support/channel_case.ex
* creating test/test/support/conn_case.ex
* creating test/test/test/views/error_view_test.exs
* creating test/.formatter.exs
* creating test/lib/test/templates/layout/root.html.leex
* creating test/lib/test/templates/layout/app.html.eex
* creating test/lib/test/templates/layout/live.html.leex
* creating test/lib/test/views/layout_view.ex
* creating test/lib/test/live/page_live.ex
* creating test/lib/test/live/page_live.html.leex
* creating test/test/test/views/layout_view_test.exs
* creating test/test/test/live/page_live_test.exs
* creating test/lib/test/gettext.ex
* creating test/priv/gettext/en/LC_MESSAGES/errors.po
* creating test/priv/gettext/errors.pot
* creating test/assets/webpack.config.js
* creating test/assets/.babelrc
* creating test/assets/js/app.js
* creating test/assets/css/app.scss
* creating test/assets/package.json
* creating test/assets/static/favicon.ico
* creating test/assets/css/phoenix.css
* creating test/assets/static/images/phoenix.png
* creating test/assets/static/robots.txt

Fetch and install dependencies? [Yn] 
* running mix deps.get
* running mix deps.compile
* running cd assets && npm install && node node_modules/webpack/bin/webpack.js --mode development

We are almost there! The following steps are missing:

    $ cd test

Your web app requires a PubSub server to be running.
The PubSub server is typically defined in a `mix phx.gen.ecto` app.
If you don't plan to define an Ecto app, you must explicitly start
the PubSub in your supervision tree as:

    {Phoenix.PubSub, name: Test.PubSub}

Start your Phoenix app with:

    $ mix phx.server

You can also run your app inside IEx (Interactive Elixir) as:

    $ iex -S mix phx.server

But I cannot tell for windows setup.

Fl4m3Ph03n1x

Fl4m3Ph03n1x OP

Should I report this issue somewhere else ?
Is there an official phoenix channel where issues like this can get more attention?

LostKobrakai

LostKobrakai

If it’s a bug (which it seems to be) then the github repo is the right place.

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
water
I’m aware of 2 such projects, are there others? git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
itzmidinesh
Hi all, I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
leoschweizer
Hi, we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
csmr
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley: Mutonex gamedesign was finish...
New
Stef-Verniers
Hello I’ve been coding in Elixir for almost two years now because of my current job where we implemented Elixir in our application. But ...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews