You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
File URLs get a trailing slash when Next.js trailingSlash is enabled (404 on every upload) #19292
Since 3.90 (#18207), formatAdminURL appends a trailing slash to every URL it builds when Next.js runs with trailingSlash: true (NEXT_TRAILING_SLASH=true). generateFilePathOrURL builds upload URLs with it, so every file URL now ends with a slash:
A file URL points at an object, not a page route. With the slash, storage adapters and CDNs resolve a different (missing) key, so every image rendered from doc.url returns 404. In our production site (Next.js on Cloudflare Workers, @payloadcms/storage-r2) every image broke right after upgrading from 3.89.0 to 3.92.1 and we had to roll back.
Admin and API routes are fine with the slash; only file URLs are affected. The same code is on main, where a ?original=true query would also end up as /image.png/?original=true.
Activity