wdelfuego / nova4-customizable-footer

Customizable footer for Laravel's Nova 4
4 stars 1 forks source link

Cannot read properties of null (reading 'nextElementSibling') #1

Closed jandante closed 2 years ago

jandante commented 2 years ago

When installing the package I get the following error in de console.

Uncaught TypeError: Cannot read properties of null (reading 'nextElementSibling') at nova4-customizable-footer:2:74

error

Should I be using another theme?

wdelfuego commented 2 years ago

The package assumes the default nova theme but should definitely be made more robust to not blindly assume that. I’ll release an update for that soon.

Could you copy paste the generated html of the footer element in your theme so I can see if I can make it work for your theme as well?

jandante commented 2 years ago

I didn't realize I didn't have the default theme. Thank you very much to check this out!

<div class="mt-8 leading-normal text-xs text-gray-500 space-y-1"><p class="text-center"> Powered by <a href="https://nova.laravel.com" class="inline-block py-1 text-primary-500 hover:text-primary-400 font-bold no-underline">Laravel Nova</a> · v4.2.2 (Silver Surfer). </p> <p class="text-center"> © 2022 Laravel LLC · by Taylor Otwell and David Hemphill </p></div>

wdelfuego commented 2 years ago

Ah, you are most probably simply using the default theme, I was confused because you asked if you should change the theme so I wrongly assumed you had some theme installed and my code wasn't robust enough to handle it. Turns out it wasn't even robust enough to handle the default theme 😅.

I've just pushed a new version that should fix the issue, and if for some reason the same problem would arise (can't find footer element) it now shows a readable warning in the console instead of the error you posted before.

Could you run composer update or reinstall this package? Problem should be solved now.

Thanks for reporting!