ex_admin icon indicating copy to clipboard operation
ex_admin copied to clipboard

module MyApp.ExAdmin.Dashboard is not available

Open mbajur opened this issue 7 years ago • 9 comments

Hello!

I've just installed a ex_admin in my phoenix app using a getting started tutorial present on this repo's README and i can't access the /admin route. Phoenix throws

function MyApp.ExAdmin.Dashboard.__struct__/0 is undefined (module MyApp.ExAdmin.Dashboard is not available)

My setup:

  • phoenix 1.3.0
  • ecto 2.1.6
  • phoenix_ecto 3.2.3
  • ex_admin master

I suspect that it's related to the fact that i'm on ex_admin master but i really can't use any other branch/tag in cause of their phoenix_ecto dependencies (master is the only one supporting 3.2). I'm not sure if i encountered a bug on master or i'm doing something wrong but - hopefully that's my fault :)

Thanks in advance!

mbajur avatar Sep 04 '17 21:09 mbajur

Hi,

try with instructions on branch phx-1.3

Anyway, I needed to change line 18 in ex_admin/lib/tasks/util.ex from: path1 = Path.join ["lib", to_string(Mix.Phoenix.otp_app()), "web"] to: path1 = Path.join ["lib", to_string(Mix.Phoenix.otp_app()) <> "_web"]

mbaleczny avatar Sep 13 '17 16:09 mbaleczny

I tried with the instruction on branch phx-1.3 and I still get the same error, even after making the change you recommended

happysalada avatar Oct 06 '17 11:10 happysalada

Did you run mix deps.compile after making the change described above?

BTW after successful mix admin.install you should add to your config/config.exs file

config :ex_admin,
  repo: MyProject.Repo,
  module: MyProjectWeb,    # NOT MyProject or MyProject.Web !
  ...

mbaleczny avatar Oct 07 '17 11:10 mbaleczny

Thanks a lot! I hadn't run mix deps.compile after making the changes, now it works

btw for anybody reading this. After that I was a little surprised that it was empty, you need to add the ressources one by one after that with the command Union.ExAdmin.Context.Ressource it's detailed in the get_started part here https://github.com/smpallen99/ex_admin/tree/phx-1.3

happysalada avatar Oct 09 '17 01:10 happysalada

@mbaleczny Cannot find ex_admin/lib/tasks/util.ex

StephanMeijer avatar Nov 07 '17 10:11 StephanMeijer

This issue is now fixed fixed in PR #403

mbaleczny avatar Nov 07 '17 12:11 mbaleczny

Following guide still doesn't work.

StephanMeijer avatar Nov 07 '17 12:11 StephanMeijer

@StephanMeijer The path ex_admin/lib/tasks/util.ex it's wrong. My mistake. It should be ex_admin/lib/mix/utils.ex, but this is not the issue anymore. You don't have to

I've followed the guide again on fresh project and it's working. Make sure you use dependency {:ex_admin, github: "smpallen99/ex_admin", branch: "phx-1.3"}. I also advise you to run mix do deps.clean -all, deps.get, deps.compile.

mbaleczny avatar Nov 07 '17 17:11 mbaleczny

I love you.

StephanMeijer avatar Nov 10 '17 13:11 StephanMeijer