Next.js Static route is failing to build as it is being treated as dynamic

I am creating a corporate website using Next.js(app router, v14.2.3). In this corporate website, I am trying to generate static routes at build time using generateStaticParams as shown below:


export const dynamicParams = false;

export async function generateStaticParams() {
  const { articles } = await getArticles(); // return empty array

  return => ({
    articleSlug: article.slug,

export default async function Page({ params: { articleSlug } }: Props) {

If getArticles() returns an empty array, the following error occurs and the build fails:

ERROR: Failed to produce a Cloudflare Pages build from the project.

The following routes were not configured to run with the Edge Runtime:
    - /medium/[articleSlug]

Please make sure that all your non-static routes export the following edge runtime route segment config: export const runtime = 'edge';

I want to ensure that the build succeeds and that the route is recognized as static even if generateStaticParams returns an empty array.

If anyone knows a solution, I would appreciate your support. Thank you.