Phoenix: The live reload logger is not silenced when generating a new project with --no-html

Created on 8 Jan 2016  路  5Comments  路  Source: phoenixframework/phoenix

Using Phoenix 1.1.1, when doing mix phoenix.new myapp --no-html, the console gets filled with:
[info] GET /phoenix/live_reload/socket/websocket log messages.
I noticed that the deps function doesn't include phoenix_live_reload when using the --no-html option. I don't know if this has anything to do with it.

Most helpful comment

I'm willing to bet you had an old phoenix app running in a browser tab with live reload enabled, which is making those requests. For --no-html, we do not plug the LiveReloader, so you shouldn't be seeing any log entries from the app. It must be from another tab?

All 5 comments

That's it. We should likely skip including the socket call and middleware for --no-html cases. :)

I'll fix this one if no one is on it

I'm willing to bet you had an old phoenix app running in a browser tab with live reload enabled, which is making those requests. For --no-html, we do not plug the LiveReloader, so you shouldn't be seeing any log entries from the app. It must be from another tab?

Ok you're right @chrismccord.
I quit all browsers and terminal sessions and started from scratch. The messages didn't show.
But reproducing it is easy and consistent.
So for the sake of clarity, this is exactly what to do to cause the log messages to appear (this is all using Phoenix 1.1.1):
In a terminal session (S1):

  • mix phoenix.new apiapp --no-html
  • cd apiapp & mix phoenix.server
  • no websocket log messages appear (good)
  • Stop the phoenix server here.

In another terminal session (S2):

  • mix phoenix.new htmlapp
  • cd htmlapp & mix phoenix.server
  • Go to http://localhost:4000 to display the default home page. Keep it open.
  • Stop the phoenix server here.
  • Go to the first terminal session (S1) and start the apiapp again. You will start getting the websocket log messages as long as the htmlapp home page is open.

I'm not sure anymore if you would consider this a bug. However, it was definitely confusing and annoying. The solution is extremely simple though (just close the tab).

Yeah there is nothing to fix here since you had two different apps running on the same host/port, with old clients attempting connections. Glad it's sorted out!

Was this page helpful?
0 / 5 - 0 ratings