Laravel-Backpack / community-forum

A workspace to discuss improvement and feature ideas, before they're actually implemented.
28 stars 0 forks source link

devtools buttons not working #682

Closed backpack-operations closed 12 months ago

backpack-operations commented 1 year ago

Hello Team, I just received this on email: "Hi There,

I just made a fresh install of backpack and devtools and when I click on add model, it'll bring up the module creation page but I cannot add new columns or relations, the button does nothing on click."

pxpm commented 1 year ago

Hey @backpack-operations please ask the user to check if there are no errors in the browser console.

My guess is that the assets are not properly loading, I'd suggest user to try php artisan basset:check and if it fails it will give the user some useful options on how to fix it.

Cheers

mous13 commented 1 year ago

Didn't receive any basset errors.

I do receive this error in the console on first press

create:1969 Uncaught TypeError: Cannot read properties of undefined (reading 'emit')
    at create:1969:29
mous13 commented 1 year ago

Upon further investigation, it seems that the website is trying to load the javascript file "livewire/livewire.js" but cannot find it as its located in "domain.com/dev/public/livewire/livewire.js"

mous13 commented 1 year ago

Issue Fixed.

Your app is hosted on a non-root path on your domain. For example: https://your-laravel-app.com/application. In this case, the actual assets will be served from /application/livewire/livewire.js, but the generated script tag, will be trying to fetch /livewire/livewire.js.

To solve either of these issues, you can configure the "asset_url" in config/livewire.php to customize what's prepended to the src="" attribute.

For example, after publishing Livewire's config file, here are the settings that would fix the above two issues:

'asset_url' => '/assets' 'asset_url' => '/application'

tabacitu commented 12 months ago

Glad you have a solution @mous13 !