Gives me Refused to apply style from 'http://domain.test/app/themes/theme/public/tinymce.css?wp-mce-49110-20201110' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Same thing happens if I try: $asset = \Roots\asset('css/tinymce.css'); which is the folder where the artifact gets built on yarn build
Edit: The warning indicates that the URI to the stylesheet is not found, rather a soft-404 HTML page is retrieved.
How is that site hosted? Development, with a VM or container? Production?
When you request the stylesheet URL from within the system where PHP-FPM runs, do you get a stylesheet or rather a soft 404 error page (HTML)? curl http://domain.test/app/themes/theme/public/tinymce.css?wp-mce-49110-20201110
Have you updated the theme-path in the bud configuration so that it matches the actual path the theme is in (including the theme folder name)?
As a workaround (rather a dirty fix, as core and plugins often rely on a functioning loopback connection and the theme URI should be correct for the assets) you can add the editor styles by relative path than by URI, which does not need a loopback connection:
It’s a project scaffolded yesterday, using Trellis with Lima. And yes, I’m getting a 404 on that URL form within the VM (Should there be a file generated without random hash at the end? Because there is no file like that).
Can you request a page / start page of the site? What is its URL then (after letting WordPress redirect)? Just http://domain.test?
The random hash at the end (tinymce.css?wp-mce-49110-20201110) is used for cache-busting as it is not a part of the file name, but rather a GET-parameter, which normally should not matter for static files.
Can you invoke commands from within the Lima VM/system? Because from within that system the domain domain.test must be resolvable and the server must listen for and answer requests from the VM IP (e.g. 127.0.0.1).
PHP-FPM (which does run WordPress) itself does the HTTP request, inside the Lima VM.
The request results in a HTML response, not in the frontend styles file.
For diagnosing the issue you have to do the request from inside the Lima VM to see how the web server responses.
Ah If I do trellis vm shell and run curl domain.test it does return the actual front page, and not a 404 page.
Both curl http://domain.test/app/themes/theme/public/css/app.d8aefd.css and curl http://domain.test/app/themes/theme/public/css/tinymce.1fc2a8.css shows the content of the files.
But should I use $asset = \Roots\asset('tinymce.css') or $asset = \Roots\asset('css/tinymce.css')? Sans the prefixed path it looks at http://domain.test/app/themes/theme/public/tinymce.css?wp-mce-49110-20201110, which obviously is empty.
Hm, upon further thought it makes sense as dev uses the proxy domain (and some free port, as this is by default localhost) instead of the original server one. Does the workaround with adding the frontend stylesheet asset by its path (instead of URL) work?
A fix of the underlying issue would probably consist of being able to retrieve the asset URL without the proxy domain and port from the manifest.