Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

thebookcollector's avatar

Hoping for some help troubleshooting and issue after Laravel 10.x to 11.x upgrade.

I've been using icehouse-ventures/laravel-chartjs (https://github.com/icehouse-ventures/laravel-chartjs) for over a year, displaying various charts in my app. A couple days ago, I upgraded Laravel from 10.x to 11.x and, in the process, upgraded laravel-chartjs from 1.1 to 4.1 as well. After these upgrades, none of my charts are working anymore.

I'm using the Livewire implementation. To keep troubleshooting super simple, I basically tried a brand new chart with a nearly exact copy/paste from the readme example.

ChartReadRatio.php

chart-read-ratio.blade.php

<div class="col-span-2">
    <div class="chart-container">
        <x-chartjs-component :chart="$chart" />
    </div>
</div>

When I visit the page, I'm getting the following error: "Undefined variable $chart"

With this line highlighted:

<x-chartjs-component :chart="$chart" />

Also, just as a quick sanity check to make sure everything was installed correctly, I also basically copy/pasted the readme example for a regular (non livewire) line chart and it worked fine - I was able to view the chart. All I had to change from the example is I removed "compact()" from the view return.

I also opened an issue in the Github repo, but it's small so I don't know how likely I am to get help there.

I know there may not be a huge number of people that have experience with this library but I'm hoping someone will see this and have a good idea on where to start or how to troubleshoot.

0 likes
0 replies

Please or to participate in this conversation.