#Using `getStaticPaths` with `fallback: false` w/ page router causes too many redirects in dev server

4 messages · Page 1 of 1 (latest)

tulip condor
#

When visiting a page that is not a provided static path, which should show the 404 page, the page crashes in chrome with the error that there were too many redirects.
E.g.

// for pages/discover/[tag].tsx
export const getStaticPaths: GetStaticPaths = () => ({
  paths: [
    { params: { tag: 'foo' } }
  ],
  fallback: false,
})

If I visit /discover/bar I would expect that I should see a 404 page, but it crashes saying there are too many redirects.

alpine epochBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

tulip condor
#

ahhh it's not just the dev server, I tried doing a prod build and it has the same problem

tulip condor
#

determined it's due to this redirect rule we have in place that's supposed to handle any requests missing our basePath of /app

{
  source: '/:path((?!app$|app/).*)',
  destination: '/app/:path',
  basePath: false,
  permanent: false,
},