wp-rocket
wp-rocket copied to clipboard
404 error in console on Safari when LazyLoad for CSS BG Images is active
Describe the bug
When LazyLoad for CSS Background Images is active, Safari shows a 404 error in the console for:
lazyload-css.min.js.map
It doesn't seem to break anything, but we shouldn't cause a console error.
To Reproduce Steps to reproduce the behavior:
- Enable LazyLoad for CSS Background Images
- Visit a page in Safari
- Check the console. Tested on WPR 3.15.9
Expected behavior No 404.
Screenshots If applicable, add screenshots to help explain your problem.
Acceptance Criteria (for WP Media team use only) Clear instructions for developers, to be added before the grooming
I can't replicate this on Safari, I dont'have the error on console with lazyload CSS enabled
Ticket: https://secure.helpscout.net/conversation/2543005887/481581/
If you check on firefox it shows the 404 error for lazyload-css.min.js.map
I have a similar case.
Found this: https://goonlinetools.com/snapshot/code/#5hmlsyg75yfn5wz8d5l0y
//# sourceMappingURL=lazyload-css.min.js.map
But lazyload-css.min.js.map
doesn't exist.
This is the ticket: https://secure.helpscout.net/conversation/2586260422/489478
We aren't generating the map file when gulp run, coincidentally this PR(https://github.com/wp-media/wp-rocket/pull/6625) fix the issue.
@MathieuLamiot , if #6625 is fixing it, should we close this issue ?
Yes, after confirming it's fixed.
The file exists and is correctly mapped in the min file, we do have a stray lazyload-css.js.min.map
that should not exist though.
Closing the issue as the files have been updated to correctly match. Please re-open if the issue arise again.
@piotrbak The issue here is that we are injecting the script on pages, which result on the sourcemap becoming relative path //# sourceMappingURL=lazyload-css.min.js.map
.
Consequently, whatever is looking for sourcemap will look for it on the same current page's path.
Either remove the sourcemap or reference an absolute path for the sourcemap or include it as a file and not inline it.
Related: https://secure.helpscout.net/conversation/2666064439/505227?folderId=2675957