i18next / next-app-dir-i18next-example

Next.js 13/14 app directory feature in combination with i18next
https://locize.com/blog/next-app-dir-i18n/
175 stars 38 forks source link

Next 13 server actions not working #29

Closed ravinggenius closed 1 year ago

ravinggenius commented 1 year ago

🐛 Bug Report

Following the Nex13 tutorial breaks server actions. The server actions work as intended on my main branch.

I followed the tutorial closely and double-checked my code against the samples in the tutorial. I suspected something in the middleware function, so I added a bunch of console logs.

To Reproduce

I created a minimal example demonstrating the issue. Clone the repo and check out the minimal-example branch. Then install dependencies and start the dev server: npm install; npm run dev. You shouldn't need to set any environment variables. Open http://localhost:3000/. Enter any email/password combination and try to "log in". I expect to see a console.log output of the credentials in the terminal window that is running the development server. (The server action createSession is defined in src/app/[locale]/actions.ts.) I suspect something about the configuration interferes with the server action routing.

Expected behavior

The browser should redirect to /profile/welcome and show a brief message. Instead the server action response is 405 method not allowed. Examining the development terminal indicates the server action is not run.

Your Environment

adrai commented 1 year ago

Seems this is a problem of Next.js when using generateStaticParams https://github.com/vercel/next.js/issues/49408 .... you need to ask the Next.js team for help...

ravinggenius commented 1 year ago

Okay. Thank you for confirming.