sebastianbergmann / php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage information.
BSD 3-Clause "New" or "Revised" License
8.83k stars 374 forks source link

Code coverage report HTMLs not rendering properly on OSX #1047

Closed woganmay closed 1 month ago

woganmay commented 1 month ago
Q A
php-code-coverage version 11.0.3
PHP version 8.3.12
Driver Xdebug
Xdebug version 3.3.2
Installation Method Composer
Usage Method PHPUnit
PHPUnit version 11.1.2

In short: The --coverage-html does its job, renders HTML, and it renders 100% fine using Chrome on Windows:

image

And despite all the CSS and JS loading, no console/network errors, etc, it fails to apply the CSS styling using Safari on Mac:

image

Any ideas?

sebastianbergmann commented 1 month ago

It renders fine for me on macOS with both Firefox and Safari.

woganmay commented 1 month ago

Thanks @sebastianbergmann ! I've got 2x OSX users on my side using Safari that it does not render for, which is strange! Any suggestions on troubleshooting this? I'm getting specific versions now and working with @nikspyratos to troubleshoot.

Update: Nik is using

The other person is using:

sebastianbergmann commented 1 month ago

Safari 18.0.1 (20619.1.26.31.7) renders the report just fine for me on macOS Sequoia (15.0.1). I am sorry, but I do not think that I can help you.

woganmay commented 1 month ago

Yeah it's looking like a weird edge case possibly involving Cloudflare Tunnels messing up MIME types @sebastianbergmann - I'll resolve this one in the rare event someone else comes across this.

Update: Confirmed 🎉

It works when served via Cloudflare's LHR hub, but the JNB hub responds with Content-Type: text/plain which causes the browser itself not to treat the CSS files as CSS.