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

j_watson's avatar

Asantibanez livewire charts not showing on deployed system.

I made some graphs that are working on my local server but they are not showing after I deployed the system.

I know the code is okay since they're working locally but is there something that I missed when I uploaded it?

0 likes
18 replies
tykus's avatar

Did you run composer update on the production server to update your dependencies?

Are you getting something other than not showing?

j_watson's avatar

@tykus I did update. I'm getting nothing at all no display and no errors.

j_watson's avatar

@tykus There is. It says Failed to load the resource: the server responded with a 404

tykus's avatar

@j_watson which resource; I can't guess?!?

The php artisan livewire-charts:install command should have copied the scripts needed by this package into your public directory - were these scripts included in your version control, or were they ignored?

j_watson's avatar

@tykus I checked my files and they are there. I think it was the directives that were causing the error so I ended up removing them and the error was gone. But now I get Alpine Expression Error: livewireChartsColumnChart is not defined and Alpine Expression Error: init is not defined

tykus's avatar

@j_watson it is difficult to understand the cause of your issue. Is there anything non-conventional about your server configuration? Do you serve from the public directory, or is there a public segment in your URL?

What is the resource URL that is not loading?

j_watson's avatar

@tykus Something here is not working. For the life of me, I can't seem to point it out. Thanks for trying.

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Laravel Test</title>

    <link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
    
    <livewire:styles />
</head>
<body class="bg-gray-200">

<livewire:infographics/>

<livewire:scripts />

<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>

@livewireChartsScripts

</body>
</html>
tykus's avatar
tykus
Best Answer
Level 104

@j_watson frustrating, I know...

I meant what URL in your network tab is giving the 404 - I am wondering if the APP_URL environment variable is incorrect (compared with the URL your application itself is using), and is therefore trying to load the scripts from an invalid URL.

1 like
j_watson's avatar

@tykus Nothing seems wrong, I checked the Network tab and all seem to be running just fine.

The erros are Uncaught ReferenceError: livewireChartsColumnChart is not defined and Uncaught ReferenceError: init is not defined and they're referencing my Alpine CDN <script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>

tykus's avatar

@j_watson I don't know how to help in that case. Perhaps if you try to make a very simple page and try to render the simplest chart, nothing else. I don't know why you needed to include the Alpine and Apex CDNs above, so maybe try to only include the Livewire and Livewire Charts directives.

j_watson's avatar

@tykus After I did what you said and think I know what's causing the error but I don't know how ti fix it.

This URL https://laraveltest.site/vendor/livewire/livewire.js can't detect my livewire.js file which is in public/vendor/livewire/livewire.js and this URL https://almondengineering.site/vendor/livewire-charts/app.js can't detect my app.js file in my public/vendor/livewire-charts/app.js directory.

Both URL's are working locally but return the 404 on live server.

j_watson's avatar

@tykus you were actually right, I had to manually move some resources because the URL was invalid. The files were unconventionally deep in my directory when uploaded live unlike on my local server where everything is just upfront. Thanks a lot tykus!

Please or to participate in this conversation.