fix(prerender): check each segment length is less than 255 chars and whole path 1024 #757
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When prerendering routes, we create a filesystem entry with directory structure corresponding to the route and serve then in production as static files.
Due to filesystem limitations (see this table for reference) filename (and directory names) can have maximum of 255 characters in most popular filesystem implementations while generally there is less limit (at least documented) limitation for the full path.
This fixes nitro check to validate each segment length splitted by
/
instead of the whole path against 255 limit. Also adds a visible warning log when skipping routes due to filesystem limits.APFS, at least also has a limitation on full path as well which is undocumented but causes
ENAMETOOLONG
error when while path (including path to/.../project/.output/public
) is longer than 1024. I have made it a soft warning to ensure we at least warn about cross platform possible issues.