tfwright / live_admin

Low-config admin UI for Phoenix apps, built on LiveView
MIT License
251 stars 22 forks source link

Cannot compile on new phoenix 1.7.0 #28

Closed dev-rroslan closed 1 year ago

dev-rroslan commented 1 year ago

== Compilation error in file lib/live_admin/view.ex == ** (CompileError) lib/live_admin/view.ex:4: module Phoenix.View is not loaded and could not be found (elixir 1.14.3) expanding macro: Kernel.use/2 lib/live_admin/view.ex:4: LiveAdmin.View (module)

tfwright commented 1 year ago

I think adding phoenix_view as a dependency should solve this issue. See https://github.com/tfwright/live_admin/issues/13#issuecomment-1423308893

zazaian commented 1 year ago

Hey @dev-rroslan - Phoenix 1.7 is so structurally different in the Web module from <= 1.6.x that several meaningful changes will need to be made in order to achieve full 1.7 compatibility. Specifically, Views have been completely replaced by Components, and routing helpers have been completely reconfigured to use the new sigil verified route syntax. It looks, from the commits, that @tfwright is already working on 1.7 compatibility, but has not issued a new tagged release with those patches.

I'd keep an eye out for the next couple of tagged releases, one of which I assume should add support for Phoenix 1.7. @tfwright please correct me if I'm wrong here.

dev-rroslan commented 1 year ago

Hi, thanks for a quick reply. I have a use case and searching for a module to disable registration but admin or registered user can invite. Thanks again.

On Thu, 2 Mar 2023 at 10:10, Mike Zazaian @.***> wrote:

Hey @dev-rroslan https://github.com/dev-rroslan - Phoenix 1.7 is so structurally different in the Web module from <= 1.6.x that several meaningful changes will need to be made in order to achieve full 1.7 compatibility. Specifically, Views have been completely replaced by Components, and routing helpers have been completely reconfigured to use the new sigil verified route syntax. It looks, from the commits, that @tfwright https://github.com/tfwright is already working on 1.7 compatibility, but has not issued a new tagged release with those patches.

I'd keep an eye out for the next couple of tagged releases, one of which I assume should add support for Phoenix 1.7. @tfwright https://github.com/tfwright please correct me if I'm wrong here.

— Reply to this email directly, view it on GitHub https://github.com/tfwright/live_admin/issues/28#issuecomment-1451169257, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT7SWTXPH5AZSRKC5Y32QETWZ76TFANCNFSM6AAAAAAVMYHXKI . You are receiving this because you were mentioned.Message ID: @.***>

dev-rroslan commented 1 year ago

here's my route but not rendering the default template. I am new to Phoenix GET /admin LiveAdmin.Components.Home :home GET /admin/:resource_id LiveAdmin.Components.Container :list GET /admin/:resource_id/new LiveAdmin.Components.Container :new GET /admin/:resource_id/edit/:record_id LiveAdmin.Components.Container :edit

here's my scope in the router: scope "/admin", UndiWeb do live_admin "/", resources: [Undi.User] end

zazaian commented 1 year ago

Hi @dev-rroslan - are you currently upgrading from Phoenix 1.6 to 1.7? Or are you working off of a freshly-generated Phoenix 1.7 application and trying to install live_admin on top of that?

tfwright commented 1 year ago

Closing this because there's nothing to do here. @dev-rroslan for general help/advice, please use the elixir forum thread: https://elixirforum.com/t/liveadmin-phoenix-admin-ui-built-on-liveview/46421

zazaian commented 1 year ago

@tfwright are you planning to publish a Phoenix 1.7 compatible tagged release? At present it does not appear that installing phoenix_view as a dependency by itself makes live_admin compatible with 1.7.

tfwright commented 1 year ago

AFAIK it should be possible to use 1.7 with LiveAdmin 0.7.2 by including phoenix_view and ensuring that route helpers are enabled. But if you have found other issues please open a new bug report, and if you can push a sample app that demonstrates the problem that would be greatly helpful. Thanks!

zazaian commented 1 year ago

Understood. I'm still running into some issues on 1.7 even with phoenix_view installed, and cannot load the live-admin index page without error. I'll post the issue I'm experiencing when I have a moment to do so.