phoenix-in-action icon indicating copy to clipboard operation
phoenix-in-action copied to clipboard

Bug - 6.2 Creating a new Phoenix application pg 109

Open rishinair-27 opened this issue 6 years ago • 8 comments

Hi,

I'm using the latest Phoenix v1.4.6

The command mix phx.new.web auction_web --no-ecto. does not work.

When i run the mix.server command, after running above, this is what i get ---

$ mix phx.server Compiling 11 files (.ex) Generated auction_web app

23:48:11.383 [info] Access AuctionWeb.Endpoint at http://localhost

And it just hangs there.

I'm not sure whether this is a bug with the Phoenix framework itself.

################################################################ Instead i had to use the mix phx.new command to get the web app/phoenix working.

rishinair-27 avatar Jun 01 '19 18:06 rishinair-27

Ran into this myself! Validated that running mix phx.new instead of mix phx.new.web solved it.

nshoes avatar Jun 03 '19 04:06 nshoes

Hmm, I'm seeing this as well with the new update. I validated it worked ~in Phoenix 1.4.2~ through Phoenix 1.4.3. I'll have to do some digging as to why this no longer works. It might be a bug in Phoenix itself.

geolessel avatar Jun 03 '19 14:06 geolessel

@geolessel the config file generated with .web is totally different than what you have listed in the repo. I think that should be the right place to start.

rishinair-27 avatar Jun 03 '19 14:06 rishinair-27

Cross posted from: https://elixirforum.com/t/mix-phx-server-has-weird-output-does-not-start-on-port-4000/22887/11

With Elixir 1.8.1 and Phoenix v1.4.6

$ mix phx.new.web auction_web --no-ecto

Is producing a ../apps/auction_web/ directory with no /config:

.gitignore README.md assets lib mix.exs priv test

But looking at the github repository for the book ( https://github.com/PhoenixInAction/phoenix-in-action/tree/master/ch06/auction_umbrella/apps/auction_web ) it looks like it is supposed to be there.

Downgraded to phx 1.4.2 (which is used in the book), deleted ../apps/auction_web/ then ran $ mix phx.new.web auction_web --no-ecto again.

Now there is a ../apps/auction_web/config directory and mix phx.server works as expected and is using port 4000.

$ mix phx.server

14:47:07.837 [info] Running AuctionWeb.Endpoint with cowboy 2.6.3 at 0.0.0.0:4000 (http)

14:47:07.845 [info] Access AuctionWeb.Endpoint at http://localhost:4000

Looks like something changed or broke between 1.4.2 and 1.4.6.

furoshikidev avatar Jun 03 '19 19:06 furoshikidev

open config/config.exs and at the end add :

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

This bug was already fixed here: https://github.com/phoenixframework/phoenix/commit/fb3c92309c02cca1e4b3d857f8f19f27987078d0

psantos10 avatar Jun 04 '19 08:06 psantos10

Thanks psantos10

rishinair-27 avatar Jun 04 '19 08:06 rishinair-27

Thanks everyone for the reports and especially @psantos10 who opened the Phoenix issue. I'm going to leave this issue open until the fix makes it into a release.

geolessel avatar Jun 04 '19 14:06 geolessel

I don't understand how this line fixed your issue ! It just does not for me Does anyone got the same issue and that line write down in the config/config.exs but still not working ?

zano-aa avatar Oct 27 '20 10:10 zano-aa