Description
Hi,
I've followed this tut step by step and literally just copied and pasted codes: https://fusionauth.io/docs/quickstarts/quickstart-javascript-nextjs-web
Besides Nx, and exporting it as standalone nothing else is different, however when I tried to build the app it throw this error at me:
$ nx build nextjs-fusionauth
> nx run nextjs-fusionauth:build
> next build
▲ Next.js 14.0.4
✓ Creating an optimized production build
✓ Compiled successfully
Skipping linting
Checking validity of types ...Failed to compile.
src/app/api/auth/[...nextauth]/route.ts
Type error: Route "src/app/api/auth/[...nextauth]/route.ts" does not match the required types of a Next.js Route.
"authOptions" is not a valid Route export field.
Warning: command "next build" exited with non-zero status code
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
NX Ran target build for project nextjs-fusionauth (5s)
✖ 1/1 failed
✔ 0/1 succeeded [0 read from cache]
Reproduce it
- Clone this repo: https://github.com/kasir-barati/nextjs-fusionauth
cd nextjs-fusionauth
npm ci
npx nx build nextjs-fusionauth
Any comment?
BTW I am trying to use FusionAuth as my OAuth provider in my fullstack app (NextJS + NestJS), although it seems like I am hitting a lot of wall breaks along the way as you can see it here: https://fusionauth.io/community/forum/topic/2679/nextjs-custom-backend-nestjs
First I was trying to use @fusionauth/react-sdk
but then I ended up with a broken build so I tried to read docs and realized that you have implemented it with NextJS a little different than what I was doing and TBF it look nicer too. So, yup, that was the back story 😅.