Closed KalleJoP closed 11 months ago
LiveAdmin requires the router to be configured to use LiveView. That error usually means that that configuration is not complete/correct. Are you able to add your own live routes that work correctly?
Since this is not a LiveAdmin error there is nothing really for me to investigate here. If you are willing to share the source of a sample app demonstrating the issue, I might be able to point you in the right direction.
Yes, the live routes work correctly.
I uploaded a sample app with the error to github, you can visit it here: https://github.com/KalleJoP/live_admin_test
Its simply the boilerplate from mix phx.new and live_admin installed.
That app does not appear to include an example of a live route that is working correctly. At a glance, it looks like you are trying to use the live_admin helper outside of your browser pipeline, which is where the missing session data the error is complaining about should come from.
Ok, now I feel stupid, thanks for your help! :)
I just did the same thing. I think it's because the documentation (README) does not mention that it needs to be in a scope, and the example code has it at the same level as the import. So I think
import LiveAdmin.Router
live_admin "/my_admin" do
admin_resource "/my_schemas", MyApp.MyResource
end
should be rewritten as
import LiveAdmin.Router
scope "/", MyAppWeb do
pipe_through :browser
live_admin "/my_admin" do
admin_resource "/my_schemas", MyApp.MyResource
end
end
as this would match a new phoenix app, and those that have heavily customized it would still know that it needs to go in a scope.
Hey folks,
I use the newest Phoenix Framework Version and I installed live_admin like in the readme. When I access the home page, the site keeps reloading.
In the console I get this message:
I did all steps but it doesn´t helped.
Environment:
Thanks for your help :)