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

bbkbbk's avatar

Livewire.js 500 error in production

I have a Livewire project which works on my local environment. However, when I set up the application on the production server (Nginx) I am getting a 500 error for livewire.js.

I have found a topic discussing this on: https://github.com/livewire/livewire/issues/242 using RunCloud service I've tried solutions from this but still can't resolve the issue.

Here are things that I've tried:

Trying to run: "php artisan vendor:publish --force --tag=livewire:assets"

When I do this command I only get this message with no changes:

"No publishable resources for tag [laravel-assets]."

Running: "php artisan vendor:publish" then setting:

'asset_url' => 'mydomain.com'. when I do this the path turns into something like: 'mydomain.com/mydomain.com?id=12jk1212 which still has the same error.

I've also tried stuff like '/public' (in RunCloud I need to set the root directory of the project to '/public' on installation) but I get the same error.

Setting an Nginx config directive to:

location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ {
       try_files $uri /index.php?$query_string;
       access_log        off;
       log_not_found     off;
       expires           14d;
}

The error turns to this when I use this config on Nginx:

Refused to execute script from 'https://mydomain.com/livewire/livewire.js?id=12jk1212' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

If I turn off MIME sniffing protection on RunCloud I get the following:

Uncaught SyntaxError: Unexpected token '<' (at livewire.js?id=12jk1212:1:1)

I'm unsure how to resolve this and my server knowledge is not great. It works on my local development setup (Laragon) so I'm assumming it might be something to do with RunCloud Nginx.

Please can anyone advise how to debug this further or a solution?

Thanks.

0 likes
7 replies
bbkbbk's avatar

Checking my laravel.log file the main output I get is this error:

Call to undefined function Symfony\Component\HttpFoundation\ignore_user_abort() {"exception":"[object] (Error(code: 0): Call to undefined function Symfony\Component\HttpFoundation\ignore_user_abort() at /vendor/symfony/http-foundation/BinaryFileResponse.php:306)

Wyxos's avatar

@bbkbbk Did you fix this issue?

[2024-07-11 11:44:38] production.ERROR: Call to undefined function Symfony\Component\HttpFoundation\ignore_user_abort() {"exception":"[object] (Error(code: 0): Call to undefined function Symfony\Component\HttpFoundation\ignore_user_abort()

bbkbbk's avatar
Level 6

@Wyxos I did fix the website in the end, however, I'm not sure how good my solution was as I couldn't get definitive help from my server host.

I think that it was definitely a server configuration issue where livewire.js was not available publicly (giving the 404). So, what I did was create a symlink between the livewire.js file in the vendor/livewire directory which went in 'public/livewire'. After that I didn't get the error and the website worked as normal.

kssee's avatar

@Wyxos

Go to Your RunCloud Web Application Web Application -> [Web Settings] Settings -> PHP Settings

getmyuid,passthru,leak,listen,diskfreespace,tmpfile,link,shell_exec,dl,exec,system,highlight_file,source,show_source,fpassthru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_open,proc_close,proc_nice,proc_terminate,escapeshellcmd,ini_alter,popen,pcntl_exec,socket_accept,socket_bind,socket_clear_error,socket_close,socket_connect,symlink,posix_geteuid,ini_alter,socket_listen,socket_create_listen,socket_read,socket_create_pair,stream_socket_server,set_time_limit,ignore_user_abort

Then you remove the string ignore_user_abort at the last part of the string.

Your 500 error will be resolved.

1 like
Wyxos's avatar

@kssee Thanks, your answer was the solution. I found it a while ago but forgot to update here.

Please or to participate in this conversation.