Skip to content

Commit

Permalink
fix: add fallback array for backwards compatibility
Browse files Browse the repository at this point in the history
`preRender.notFoundRoutes` was only [introduced around v9.5.6](vercel/next.js#8832)

type PrerenderManifest = {
  version: 3
  routes: { [route: string]: SsgRoute }
  dynamicRoutes: { [route: string]: DynamicSsgRoute }
  notFoundRoutes: string[]
  preview: __ApiPreviewProps
}
  • Loading branch information
sreetamdas committed May 28, 2022
1 parent 6af06da commit c33bc1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next-sitemap/src/url/create-url-set/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const createUrlSet = async (
urlSet = [...new Set(urlSet)]

// Remove routes which don't exist
const notFoundRoutes = manifest.preRender?.notFoundRoutes as string[]
const notFoundRoutes = (manifest.preRender?.notFoundRoutes ?? []) as string[]
urlSet = urlSet.filter((url) => !notFoundRoutes.includes(url))

// Create sitemap fields based on transformation
Expand Down

0 comments on commit c33bc1f

Please sign in to comment.