[🐛 Bug]: Build fails if getStaticPaths
return an empty array
#743
Labels
bug
Something isn't working
getStaticPaths
return an empty array
#743
next-on-pages environment related information
System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020
CPU: (12) arm64 Apple M2 Pro
Memory: 16 GB
Shell: /bin/zsh
Package Manager Used: npm (9.8.1)
Relevant Packages:
@cloudflare/next-on-pages: 1.11.0
vercel: N/A
next: 14.2.0
Description
getStaticPaths
is used to control what pages to generate at build time for a dynamic route. Returning an empty array means "build no pages" for this route. This can happen when the content on the path varies over time and there may be no content at all or it can be used to hide test-pages in production for example.Having
getStaticPaths
return nothing works withnpm run build && npm start
but fails thenext-on-pages
build with the following error:Adding runtime edge to the route yields another error asking you to change edge to experimental-edge which in turn makes the build succceed but the route fail with a 500 error.
Reproduction
https://github.com/gabrielf/getstaticpaths-empty-return
Pages Deployment Method
None
Pages Deployment ID
No response
Additional Information
No response
Would you like to help?
The text was updated successfully, but these errors were encountered: