Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server wont start and don't receive any error #3429

Closed
psantos10 opened this issue May 31, 2019 · 7 comments
Closed

Server wont start and don't receive any error #3429

psantos10 opened this issue May 31, 2019 · 7 comments

Comments

@psantos10
Copy link

Environment

  • Elixir version (elixir -v): 1.8.2
  • Phoenix version (mix deps): 1.4.6
  • NodeJS version (node -v): 10.15.3
  • NPM version (npm -v): 6.9.0
  • Operating system: macOS Mojave v 10.14.5

Expected behavior

Steps to reproduce:

$ mix local.hex
$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.4.6
$ mix new --umbrella demo
$ cd demo/apps
$ mix phx.new.web demo_web --no-ecto

At this stage, edit config/config.exs and add, at the end the following line: config :phoenix, :json_library, Jason

$ cd demo_web
$ mix phx.server

At this point I expect the server to be running

Actual behavior

The server did not start: Tried the same on differents PCs, even with one from Brazil :)

Result:

➜ demo_web $ mix phx.server
17:08:46.922 [info] Access DemoWeb.Endpoint at http://localhost

Nothing more...

@mdepolli
Copy link

Successfully reproduced it following the same steps. Interesting that the [info] Running SeatScoutsWeb.Endpoint with cowboy 2.6.3 at 0.0.0.0:4000 (http) line doesn't appear in stdout.

@britto
Copy link
Contributor

britto commented May 31, 2019

Hey, @psantos10. Have you tried adding import_config "#{Mix.env()}.exs" after the config :phoenix, :json_library, Jason line?

@psantos10
Copy link
Author

psantos10 commented May 31, 2019

adding import_config "#{Mix.env()}.exs" solved the issue. Thank you!

But how should I know about this?

if I try to run without this: config :phoenix, :json_library, Jason I will receive an error like this:

warning: failed to load Jason for Phoenix JSON encoding
(module Jason is not available).

Ensure Jason exists in your deps in mix.exs,
and you have configured Phoenix to use it for JSON encoding by
verifying the following exists in your config/config.exs:

config :phoenix, :json_library, Jason

Maybe the same should happen for this case.

@britto
Copy link
Contributor

britto commented May 31, 2019

Indeed, this is something that might be worth adding to the config template for the phx.new.web generator.

@mdepolli
Copy link

I can also confirm that works. I have also checked the behavior of previous versions and it seems this behavior started with 1.4.4 -- probably related to the change to generators not including config files for children apps.

@mdepolli
Copy link

@britto Sounds like a good first PR for me to work on!

josevalim pushed a commit that referenced this issue Jun 1, 2019
@taka41s
Copy link

taka41s commented Mar 10, 2022

got the same error yesterday, someone knows how to fix in nowadays?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants