Static Generation creates File Names that are Too Long
-
Howdy, I hope everyone’s day is going well.
Whenever I generate static files for my build, I have encountered an issue where the file path is too long as a result of renamed images.
The homepage contains a business logo which, when converted into html, does not display the logo’s PNG file on my local machine (the build was created using LocalWP on Windows 11). Upon inspection (the html was viewed in both FireFox and Edge, and neither displayed the image), I determined that the image is not displaying due to the (relative) file path being too long- I am told that Windows doesn’t handle file paths in excess of 260 characters very well. I discovered that the PNG file had been renamed to something much different then what I uploaded the file to WordPress, and the file’s name had about 60 additional random characters appended to its original name. When the name of the PNG was changed to something short like ‘Logo.png’ and the file path edited to match, the image displayed properly (‘logo.png’ was not the original name of the image file, so it was not an issue caused by referencing the wrong image/a nonexistent image/having the wrong file name).
While I could leave it at that for this particular instance of the error, I have this same PNG file referenced throughout the website, and the file paths are all broken as a result. Additionally, updating the build and regenerating the static files would cause me to repair every instance of the logo every time the site updated.
It seems to me that the solution should be to prevent this png’s file rename from being excessively long during static generation. Does anyone else have this issue? Is there a known solution?
Plugins Used:
-Simply Static
-Elementor
-Yoast SEO
-Elementor Header & Footer BuilderSettings:
-built on LocalWP
-Web server: Apache
-PHP version: 8.3.0
-Wordpress version: 6.5.3Thanks in advance!
- The topic ‘Static Generation creates File Names that are Too Long’ is closed to new replies.