Next.js Discord

Discord Forum

Using generateStaticParams causing 405 error while Hitting POST request

Unanswered
SID posted this in #help-forum
Open in Discord
SIDOP
Hi I have configured i18n in nextjs 13 app router using official docs https://nextjs.org/docs/app/building-your-application/routing/internationalization
but I have started getting 405 method not allowed when I use server pages to submit forms

here is similar issue
https://github.com/vercel/next.js/issues/49408

export async function generateStaticParams() {
  return i18n.locales.map((locale) => ({ lang: locale }));
}



Can anyone help me with this?

7 Replies

@SID But I will need it for i18n
well but it is a confirmed bug being investigated by the team as you can see by the [NEXT-1167] tag. you can only use workarounds for now. server actions are in alpha so very unstable, expect bugs
@SID Is there anything else that can provide me same functionality without compromising Server actions?
you can check the issue and look for workaround – if there is any good workaround it should be there already
if you can't find a workaround good enough, high chances it is simply not possible
if you can do it, you should also try to fix the bug yourself and make a pull request to the nextjs repository