Next.js Discord

Discord Forum

Vercel Session deployment failure.

Unanswered
Dickcissel posted this in #help-forum
Open in Discord
DickcisselOP
Receiving an error:
https://mypage.vercel.app/pages/signInPage?callbackUrl=https%3A%2F%mypage.vercel.app%2F&error=CredentialsSignin 404 not found after authentication. Sessions work locally with no issues. Additonal issue with .svg not displaying form public folder after deployment.

26 Replies

DickcisselOP
I am not sure what additional details are useful to start the dialogue. Here are my callbacks from my authOptions.

callbacks: { async jwt(params: { token: any, user: any }) { const { token, user } = params; // Add role to the token only at the time of signing in if (user) { return { ...token, userId: user.id, role: user.role, organizationId: user.orgId, } } else { return token } }, async session(params: { session: any, token: any, user: any, newSession: any, trigger: "update" | "signout" }) { const { session, token, user } = params; if (user) { return { ...session, userId: user.id, role: user.role, organizationId: user.orgId, name: user.firstName + " " + user.lastName, email: user.email, } } else { return token } } },
American black bear
do you have any errors?
check the chrome console
DickcisselOP
POST https://napticcore-oqbnjc5wm-napticai.vercel.app/api/auth/callback/credentials 401 (Unauthorized) (anonymous) @ /_next/static/chunks…44486652c9929c.js:1 h @ /_next/static/chunks…44486652c9929c.js:1 i.value @ /_next/static/chunks…44486652c9929c.js:1 (anonymous) @ /_next/static/chunks…44486652c9929c.js:1 e @ /_next/static/chunks…44486652c9929c.js:1 i @ /_next/static/chunks…44486652c9929c.js:1 Promise.then (async) e @ /_next/static/chunks…44486652c9929c.js:1 i @ /_next/static/chunks…44486652c9929c.js:1Promise.then (async)
e @ /_next/static/chunks…44486652c9929c.js:1
i @ /_next/static/chunks…44486652c9929c.js:1
(anonymous) @ /_next/static/chunks…44486652c9929c.js:1
(anonymous) @ /_next/static/chunks…44486652c9929c.js:1
N @ /_next/static/chunks…44486652c9929c.js:1
e.signIn @ /_next/static/chunks…44486652c9929c.js:1
c @ /_next/static/chunks…0fff484b52e104.js:1
eU @ /_next/static/chunks…2d513830bf1687.js:9
eH @ /_next/static/chunks…2d513830bf1687.js:9
(anonymous) @ /_next/static/chunks…2d513830bf1687.js:9
re @ /_next/static/chunks…2d513830bf1687.js:9
rn @ /_next/static/chunks…2d513830bf1687.js:9
(anonymous) @ /_next/static/chunks…2d513830bf1687.js:9
oN @ /_next/static/chunks…2d513830bf1687.js:9
eF @ /_next/static/chunks…2d513830bf1687.js:9
ro @ /_next/static/chunks…2d513830bf1687.js:9
nU @ /_next/static/chunks…2d513830bf1687.js:9
nD @ /_next/static/chunks…2d513830bf1687.js:9
`
American black bear
no not this
check response from network tab
DickcisselOP
Attempting to recreate locally it is acting as if the deployment is pointing to a different database than local, which does not appear to be the case based on deployment logs
American black bear
have you changed you redirect uri from localhost to your websites?
DickcisselOP
I may have done the classic developer thing. I may have foudn the problem after asking for help :/
American black bear
better than nothing!
DickcisselOP
looks like I am NOT pointing to the same db locally as in prod
womp womp. Thanks duck. Any advise on the svg issue I'm seeing?
GET https://napticcore-oqbnjc5wm-napticai.vercel.app/napticLogo.svg 404 (Not Found). The svg lives in my public folder
American black bear
what svg's are you using?
if they are just icons you can use lucide-react
DickcisselOP
I am using a custom one I created based from my company logo
I am using some lucide-react in my app and they are displaying correctly
If I look at my output of my build I see the logo in the route but receive the above 404 when it's attempted to be accessed
DickcisselOP
loading it thusly
<Image src="/napticlogo.svg" alt="Logo" width={40} height={40} className="h-10 w-10 rounded-full" />
Once again, a pebkac error... notice the camel case vs all lower case. Thanks for your attempt at helping duck.
American black bear
you are missing quality i think
here is an image in my project and it loads correctly
DickcisselOP
Sorry, just saw this, sorry, my issue was casing. Looks like quality is not a required attribute