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
According to the documentation setting the useFileSystemPublicRoutes configuration option to false prevents routing based on files in /pages directory. If this option is set to false in combination with using a custom server, images (and most likely other file types) are not served from the /public directory. The 404 page is served instead.
To Reproduce
Use an example with custom server (tested with Fastify)
Create /public directory with an image inside
Add HTML image tag with the /image-name as src attribute to any page
Add next.config.js file to the root with the following content:
module.exports={useFileSystemPublicRoutes: false}
Open modified page in the browser
Expected behavior
Image is shown regardless of useFileSystemPublicRoutes configuration option's value.
The text was updated successfully, but these errors were encountered:
Essentially the "catch all" is only included if useFileSystemPublicRoutes is set to true - however DevServer relies on "catch all" to serve files from the public folder.
Because we do not rely on the catch all method for production - this issue doesn't occur in production for serving files from the public folder.
Q: Anyone see any issue with moving routes.push(catchAllRoute); outside of the useFileSystemPublicRoutes check?
Shinyaigeek
added a commit
to Shinyaigeek/next.js
that referenced
this issue
Jan 7, 2020
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 30, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Describe the bug
According to the documentation setting the
useFileSystemPublicRoutes
configuration option tofalse
prevents routing based on files in/pages
directory. If this option is set tofalse
in combination with using a custom server, images (and most likely other file types) are not served from the/public
directory. The 404 page is served instead.To Reproduce
/public
directory with an image inside/image-name
assrc
attribute to any pagenext.config.js
file to the root with the following content:Expected behavior
Image is shown regardless of
useFileSystemPublicRoutes
configuration option's value.The text was updated successfully, but these errors were encountered: