Error: `export const config` in /vercel/path0/app/api/auth/login/route.ts
Unanswered
Gull Dong posted this in #help-forum
Gull DongOP
When building my project I get this error which comes from the /app/api/auth/[...nextauth].ts file
38 Replies
Gull DongOP
my code
Build error occurredError:
export const config in C:\Users\Xolify\Documents\GitHub\confidentialclo\app/api/auth/login/route.ts is deprecated. Please change runtime property to segment export config. See https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-configat getPageStaticInfo (C:\Users\Xolify\Documents\GitHub\confidentialclo\node_modules\next\dist\build\analysis\get-page-static-info.js:365:27)
at async getStaticInfoIncludingLayouts (C:\Users\Xolify\Documents\GitHub\confidentialclo\node_modules\next\dist\build\entries.js:81:28)
at async C:\Users\Xolify\Documents\GitHub\confidentialclo\node_modules\next\dist\build\entries.js:362:32
at async Promise.all (index 2)
at async Promise.all (index 0)
at async createEntrypoints (C:\Users\Xolify\Documents\GitHub\confidentialclo\node_modules\next\dist\build\entries.js:482:5)
at async Span.traceAsyncFn (C:\Users\Xolify\Documents\GitHub\confidentialclo\node_modules\next\dist\trace\trace.js:103:20)
at async webpackBuildImpl (C:\Users\Xolify\Documents\GitHub\confidentialclo\node_modules\next\dist\build\webpack-build\impl.js:102:25)
at async webpackBuild (C:\Users\Xolify\Documents\GitHub\confidentialclo\node_modules\next\dist\build\webpack-build\index.js:137:16)
at async C:\Users\Xolify\Documents\GitHub\confidentialclo\node_modules\next\dist\build\index.js:586:123
- info Creating an optimized production build .
full error
Gull DongOP
Anyone?
European sprat
It tells you in the error what's wrong
export const config is deprecated@European sprat `export const config` is deprecated
Gull DongOP
Yes but have you looked at my code
I’m using next auth
And they said it isn’t there problem
@Gull Dong Click to see attachment
Gull DongOP
^ code
European sprat
Maybe you're using some old version?
@European sprat Maybe you're using some old version?
Gull DongOP
13.4.12
When I update to a new one my site doesn’t work
European sprat
i meant next-auth
@European sprat i meant next-auth
Gull DongOP
?
@Gull Dong ?
European sprat
you've committed your mongo db url which has username and password in your .env
i'd suggest changing that asap and not committing the .env file
there's some stuff wrong here like you have mixed pages directory _app and _document into the app directory
i don't know if it actually matters... but it's definitely not right
they might actually get ignored
@European sprat you've committed your mongo db url which has username and password in your .env
Gull DongOP
So what am I supposed to do to fix it
Cuz I got a customer waiting for this
European sprat
@Gull Dong i don't know but i would definitely take down that repo and change all your secrets because they are all up there
Gull DongOP
Oh yeah true
Thanks
Gull DongOP
@European sprat
European sprat
I have no idea how to fix your issue. Make a MINIMAL reproduction and I will look again
@European sprat I have no idea how to fix your issue. Make a MINIMAL reproduction and I will look again
Gull DongOP
explain please
I don't understand what oyu mean by MINIMAL reproduction
European sprat
Meaning I can easily run the code with basic instructions and clearly see the error being reproduced
@European sprat Meaning I can easily run the code with basic instructions and clearly see the error being reproduced
Gull DongOP
Everything is there
you just gotta npm i and npm run dev
on the repo
the problem is when building
your repo was likely too complex for us to have time to debug
we respect the helpers' time, they are volunteering so please, help them help you