Very long path names cause ENAMETOOLONG errors when we try to write out their page data
See original GitHub issueMost file systems / OSs restrict the length of file names cause computers used to be weak sauce.
https://serverfault.com/questions/9546/filename-length-limits-on-linux/9548#9548
Generally to 255 bytes.
An obscure error someone can run into is they’ll create paths longer than this and when we try to write out the page’s page data, Node will crash with a mysterious ENAMETOOLONG
.
We should just detect when a path is too long & shorten it within the limits.
We can use a simple algorithm that trims back the path name & hashes the trimmed off parts to preserve uniqueness.
To see a real-world example of this happening & an example algorithm go to https://github.com/gatsbyjs/gatsby/issues/20338#issuecomment-575930958
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Strapi >>> Facing "ENAMETOOLONG: name too long" error
Your example filename looks exactly 255 bytes, but you have a "fancy quote" in there. ... The error is entirely correct: name too...
Read more >NodeJS create Raster with DataURL - name too long error
Tried to open a new Issue with this but GitHub just reloads the same new issue page when I ... Error: ENAMETOOLONG, name...
Read more >Contributing to Gatsby - Issue #20699 | Writing - Kirill Vasiltsov
First of all, here's the issue that is the topic of this post. It describes a possible build error when directories/filenames built by...
Read more >Destination Path Too Long Fix (when Moving/Copying a File)
The file name (s) would be too long for the destination folder. You can shorten the file name and try again, or try...
Read more >gleam/erlang/file - gleam_erlang
Inappropriate file type or format. Usually caused by trying to set the “sticky bit” on a regular file (not a directory). Eintr.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes, that 😃
Should be fixed by #21518. We probably should close this?