mcrumm / phoenix_profiler

Web Profiler and Debug Toolbar for Phoenix Framework
MIT License
200 stars 6 forks source link

Unable to use #69

Closed montogeek closed 1 year ago

montogeek commented 1 year ago

Hi!

I am wondering if this library is compatible with:

 defp deps do
    [
      {:phoenix, "~> 1.7.1"},
      {:phoenix_ecto, "~> 4.4"},
      {:ecto_sql, "~> 3.6"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 3.3"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:phoenix_live_view, "~> 0.18.16"},
      {:floki, ">= 0.30.0", only: :test},
      {:phoenix_live_dashboard, "~> 0.7.2"},
      {:esbuild, "~> 0.5", runtime: Mix.env() == :dev},
      {:tailwind, "~> 0.1.8", runtime: Mix.env() == :dev},
      {:swoosh, "~> 1.3"},
      {:finch, "~> 0.13"},
      {:telemetry_metrics, "~> 0.6"},
      {:telemetry_poller, "~> 1.0"},
      {:gettext, "~> 0.20"},
      {:jason, "~> 1.2"},
      {:plug_cowboy, "~> 2.5"},
      {:phoenix_profiler, "~> 0.2.0"}
    ]
  end

I have followed the guide and always get this error:

attempted to enable profiling but no profiler is configured on the endpoint

montogeek commented 1 year ago

After debugging a bit I found this: image

Config is correct but still check_profiler_running returns an error.

mcrumm commented 1 year ago

Hi @montogeek! Did you follow the instructions from the README or from the package docs? Please use the published package docs because the main branch has diverged in preparation for the next release.

For clarity, these are the most important steps, but please reference the full instructions:

# lib/my_app_web/telemetry.ex
children = [
  {PhoenixProfiler, name: MyAppWeb.Profiler},
  # :telemetry_poller, etc.
]
# config/dev.exs
config :my_app, MyAppWeb.Endpoint,
  phoenix_profiler: [server: MyAppWeb.Profiler]
# lib/my_app_web/endpoint.ex
if code_reloading? do
  # plugs...
  plug PhoenixProfiler
end
montogeek commented 1 year ago

OH yes, I manage to do if after adding the :server, hope you can release it soon.

I am used to read READMEs on GitHub instead of the published version :D

montogeek commented 1 year ago

What are you plans long term with the plug? I thought I would get something like Laravel Debugbar, but I couldn't see a way to see assigns for example, would like to contribute :)

mcrumm commented 1 year ago

I am glad to read it is working for you now :)

My long-term plans are similar, in fact my inspiration was exactly the Symfony Web Debug Toolbar. Please feel free to open issues with ideas– for assigns specifically I am currently working on something that will mimic dump-based debugging, so definitely stay tuned for that!