Next.js Discord

Discord Forum

What mean this error?

Unanswered
Somali posted this in #help-forum
Open in Discord
SomaliOP
i have this project structure , but still get this error on build.

i filter 'index' page , but this dont help.
this is getStaticPaths on [slug].js in the root

export async function getStaticPaths({ locales }) {
  const paths = await Promise.all(
    locales.map(async (locale) => {
      const data = await getAllPageIds(locale);
      return data
        .flatMap((item) => {
          if (item.resources) {
            return item.resources.map((resource) => {
              return {
                params: {
                  slug: resource.alias,
                },
                locale,
              };
            });
          } else {
            return {
              params: {
                slug: item.alias,
              },
              locale,
            };
          }
        })
        .filter((item) => item.params.slug !== 'index');
    })
  );

  return {
    paths: paths.flat(),
    fallback: false,
  };
}


what wrong?
why i still get this error.
On other project with same code i dont get this error.
what should i do?

0 Replies