mcrumm/phoenix_profiler

Should it be installed only in dev environment?

Closed this issue · 3 comments

{:phoenix_profiler, "~> 0.1.0", github: "mcrumm/phoenix_profiler", only: [:dev]} 

Can we do this?
My concern was, we are configuring PhoenixProfiler in application.ex - if the module is not available, in production that might generate error.

The above question arrived due to a peculiar problem I am facing.
I have deployed two Phoenix Applications on to one EC2 instance. When I compiled the 2nd application it generated an error message with PhoenixProfiler. I had to remove Profiler from the 2nd application and deploy again.

Sorry, this is not an issue with your library. But, I did not know where to ask.

Hi @cvkmohan! Right now you need to install the package in all environments, but you would configure the profiler on your Endpoint only in the :dev environment.

Can you share the error that was generated in the 2nd application? It could absolutely be an issue, because this library is very new :)

Thanks @mcrumm

(RuntimeError) attempted to enable profiling but no profiler is configured on the endpoint
    (phoenix_profiler 0.1.0) lib/phoenix_profiler/utils.ex:92: PhoenixProfiler.Utils.enable_profiler_error/2
    (phoenix_profiler 0.1.0) lib/phoenix_profiler.ex:45: PhoenixProfiler.on_mount/4
    (phoenix_live_view 0.17.6) lib/phoenix_live_view/lifecycle.ex:148: anonymous fn/4 in Phoenix.LiveView.Lifecycle.mount/3
    (phoenix_live_view 0.17.6) lib/phoenix_live_view/lifecycle.ex:183: Phoenix.LiveView.Lifecycle.reduce_socket/3
    (phoenix_live_view 0.17.6) lib/phoenix_live_view/utils.ex:299: anonymous fn/6 in Phoenix.LiveView.Utils.maybe_call_live_view_mount!/5
    (telemetry 1.0.0) /home/ubuntu/my_app/deps/telemetry/src/telemetry.erl:293: :telemetry.span/3
    (phoenix_live_view 0.17.6) lib/phoenix_live_view/channel.ex:949: Phoenix.LiveView.Channel.verified_mount/8
    (phoenix_live_view 0.17.6) lib/phoenix_live_view/channel.ex:58: Phoenix.LiveView.Channel.handle_info/2

is the error message.

Thanks for the report! Closing in favor of #52 – stand by! :)