Phoenix: Phoenix 1.2.3 or 1.2.4 and Plug 1.4 causing lots of errors logged for Plug.MIME functions

Created on 24 Jul 2017  路  4Comments  路  Source: phoenixframework/phoenix

Environment

  • Elixir version (elixir -v): 1.4.5
  • Phoenix version (mix deps): 1.2.4
  • NodeJS version (node -v): n/a
  • NPM version (npm -v): n/a
  • Operating system:

Phoenix 1.2.3 and 1.2.4 allow Plug 1.4 but also call Plug.MIME functions, but Plug 1.4 is trying to deprecate Plug.MIME functions, resulting in a lot of errors logged:

Plug.MIME.type/1 is deprecated, please use MIME.type/1 instead
    (phoenix) lib/phoenix/controller.ex:636: Phoenix.Controller.do_render/4
    (phoenix) lib/phoenix/endpoint/render_errors.ex:58: Phoenix.Endpoint.RenderErrors.__catch__/5
    (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
    (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

https://github.com/elixir-plug/plug/blob/v1.4.0/lib/plug/mime.ex#L24-L28

open for guidance

Most helpful comment

I have pushed a fix to v1.2 that does not allow v1.4 to be picked. @chrismccord can you please do a new v1.2 release?

All 4 comments

You need to either bump to v1.3.0-rc.2 or set {:plug, "~> 1.3.0"} in your mix.exs file for now. Phoenix always allowed later Plug versions, it just happens that we got a new Plug out now. Thanks for the report!

Opening for guidance.

@josevalim would you be open to a PR to fix this on 1.2? I know a lot of folks won't be able to update to 1.3 immediately.

I have pushed a fix to v1.2 that does not allow v1.4 to be picked. @chrismccord can you please do a new v1.2 release?

Was this page helpful?
0 / 5 - 0 ratings