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
runtime version: node v18.7.0; Chrome Version 115.0.5790.182 (Official Build) (64-bit)
i18next version: 23.4.6
os: ChromeOS Version 115.0.5790.182 (Official Build) (64-bit)
🐛 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 aconsole.log
output of the credentials in the terminal window that is running the development server. (The server actioncreateSession
is defined insrc/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 is405 method not allowed
. Examining the development terminal indicates the server action is not run.Your Environment