Hello. Is your site able to perform loopback requests? Please check your Site Health in the admin to see if there are any issues with loopback requests.
Can you share a screenshot of the error you’re seeing?
I’m guessing you’re seeing something like this:
The error is is being detected here in the code: https://github.com/ampproject/amp-wp/blob/c2a2f10ad8639d5025249e90e5d4bf2c5882a541/includes/sanitizers/class-amp-style-sanitizer.php#L1510-L1513
When an error occurs say because of a 404, then the error will be cached. So if you update the id
parameter in the stylesheet URL then that will bust the cache and it may resolve the issue.
I’ve also just opened a PR to make it so the HTTP status code is displayed: https://github.com/ampproject/amp-wp/pull/6255
Hi. Yes, it’s clearly what I see.
See screenshot here : https://i.imgur.com/irnUkkyl.png
So what should I do? Just empty cache (which is not supposed to be active on this site)
-
This reply was modified 2 years, 11 months ago by bonakor.
That Imgur link takes me to a 404.
Fetched stylesheets are stored in transients if a persistent object cache is not enabled for a site. So you can try flushing all transients. You can do so via the Transients Manager plugin.
All right, I’ll try that. Thanks
Maybe this link will work : https://imgur.com/a/dgOLpyY#irnUkky
-
This reply was modified 2 years, 11 months ago by bonakor.
Okay, I flushed all transients, but I still have the issue.
Even the AMP Stylesheet is unfetchable. See screenshot : https://www.dropbox.com/s/m3x0hm2veqmjuno/Capture%20d%E2%80%99%C3%A9cran%202021-05-15%20%C3%A0%2020.26.57.png?dl=0
-
This reply was modified 2 years, 11 months ago by bonakor.
Ok, are you using a plugin that is stripping out the host name to make all URLs relative? If so, which one?
OK, great. I can reproduce the issue if I add a stylesheet that does not include the hostname then I get the same error. When you call asset('styles/app.css')->uri()
does this just return the absolute path? If so, as a quick fix I recommend prefixing with the hostname like so:
'//' . wp_parse_url( home_url(), PHP_URL_HOST ) . asset('styles/app.css')->uri()
I’ll file an issue to add support for such hostless paths.
I tried to add the full path but it’s still unfetchable, and in my console, I have only relative paths which makes me say that something on my site is forcing relative paths.
I’m investigating what it could be.
I found it, and it’s working when I remove the relative url.
Thanks. I’ve drafted a pull request to prevent this from being an issue in the future: https://github.com/ampproject/amp-wp/pull/6257