NextAuth auth flow causes Next.js 13 dev server to crash without throwing any errors
I'm building a note-taking app with ct3a (partly inspired by Jack Herrington's awesome T3 video) but I'm having a really weird issue with NextAuth where the auth flow succeeds, OAuth2 callback route is hit, but then for some reason the Next.js dev server crashes without throwing any errors whatsoever.
I'm positive the auth flow is working properly because running NextAuth in debug mode shows a successful OAuth2 callback response with data - but it's still not throwing errors. Here's a slightly censored version of the console output from NextAuth:
Currently my NextAuth config has Google and Discord as OAuth providers, but they both end up crashing the Next.js dev server inexplicably.
Here is the repo - relevant code can be found in the editor branch. No detailed README yet but it's just a standard ct3a Next.js project: Prisma, Tailwind, NextAuth, TRPC
https://github.com/ChromeUniverse/luccanotes/tree/editor
GitHub
GitHub - ChromeUniverse/luccanotes at editor
A full-stack note-taking app for Markdown lovers ❤️ - GitHub - ChromeUniverse/luccanotes at editor
16 Replies
share github repo
yep just pushing some changes to a new branch
ima spin up postgres and run it see what happens
okie dokie, much appreciated - I've added some more info in the main post
Oh, interestingly enough, Vercel shows some errors on build
Ah never mind, it's just complaining that I forgot to set the env vars on Vercel but I don't think that's useful
I've added a dummy login button that invokes NextAuth's
signIn()
methodfor me its saying its missing type defs for @codemirror\state
Huh
fixed it idk what happened lol
Wait that doesn't make sense
npm
@codemirror/state
Editor state data structures for the CodeMirror code editor. Latest version: 6.2.0, last published: 2 months ago. Start using @codemirror/state in your project by running
npm i @codemirror/state
. There are 263 other projects in the npm registry using @codemirror/state.look, @codemirror/state has built-in TS defs
i did pnpm i @codemirror/state and it worked, idk why it didnt install when i did pnpm i
well shoot
so, i can login just fine but i did 1 change, i removed google cuz never set that shit up for oauth but ill try with it
I just checked and
@codemirror/state
really wasn't in the package.json lol
My bad