Octane/Swoole not working with Livewire

@fideloper-fly Do you know why this is? This might not be a Fly issue btw.

The livewire.js is loading fine according to the network tab, but the response header is content-type: text/html; charset=UTF-8. I looked at another app that doesn’t use Swoole/Octane and there the content type is application/javascript; charset=utf-8.

This causes this error to show up in the browser:

Refused to execute script from 'livewire.js?id=9a36ebbddb8dd0aa91b1'
because its MIME type ('text/html') is not executable, 
and strict MIME type checking is enabled.

I’m using the default fly launch configuration (generated today)

That SOUNDS like a livewire/octane issue to me on the surface, and publishing the assets fixes it by creating a real file, instead of falling back to PHP to return a response.

Googling around, I found a Fly.io community post about it (ha!) - publishing the assets fixed it.

I guess I am shite at googling. Thanks for the quick reply! I will give that a shot.

Works like a charm, thanks :heart:

1 Like