Description
Link to the code that reproduces this issue
https://github.com/Gul7333/urdudictinory/actions/runs/15373691466/job/43256067868
To Reproduce
i have next js project which uses nextjs static export , the problem is my sttaic export is litle large like 100k+ pages , these pages are simple , when i build only 5000 pages it work but when i build full sttaic pages it fails
as this static param generte function work as i am slicing only 5000 pages
export function generateStaticParams() {
const slugs = dictionaryData.slice(0,5000)
.filter((item) => item && item[1]) // Filter out null/undefined and missing index
.map((item) => ({
slug: item[1],
}));
return slugs
}
but when i remove slice
// export const revalidate = 60
export function generateStaticParams() {
const slugs = dictionaryData.slice(0,5000)
.filter((item) => item && item[1]) // Filter out null/undefined and missing index
.map((item) => ({
slug: item[1],
}));
return slugs
}
it gives this errro
npm run build
[email protected] build
next build
▲ Next.js 15.3.2
- Environments: .env
Creating an optimized production build ...
✓ Compiled successfully in 60s
Skipping linting
✓ Checking validity of types
Collecting page data .[RangeError: Maximum call stack size exceeded]
Build error occurred
[Error: Failed to collect page data for /word/[slug]] { type: 'Error' }
Current vs. Expected behavior
i have next js project which uses nextjs static export , the problem is my sttaic export is litle large like 100k+ pages , these pages are simple , when i build only 5000 pages it work but when i build full sttaic pages it fails
as this static param generte function work as i am slicing only 5000 pages
export function generateStaticParams() {
const slugs = dictionaryData.slice(0,5000)
.filter((item) => item && item[1]) // Filter out null/undefined and missing index
.map((item) => ({
slug: item[1],
}));
return slugs
}
but when i remove slice
// export const revalidate = 60
export function generateStaticParams() {
const slugs = dictionaryData.slice(0,5000)
.filter((item) => item && item[1]) // Filter out null/undefined and missing index
.map((item) => ({
slug: item[1],
}));
return slugs
}
it gives this errro
npm run build
[email protected] build
next build
▲ Next.js 15.3.2
Environments: .env
Creating an optimized production build ...
✓ Compiled successfully in 60s
Skipping linting
✓ Checking validity of types
Collecting page data .[RangeError: Maximum call stack size exceeded]
Build error occurred
[Error: Failed to collect page data for /word/[slug]] { type: 'Error' }
Provide environment information
ubuntu
Next.js 15.3.2
Which area(s) are affected? (Select all that apply)
Dynamic Routes, dynamicIO, create-next-app
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
No response