All NextJS <Link>'s cause error 500 on Vercel, but work locally
Answered
Asiatic Lion posted this in #help-forum
Asiatic LionOP
I've been building little side project, and now latest thing I've been tried to get working is parallel routes for modals. Unfortunately with latest deployment to Vercel, I noticed that after logging into my dashboard, none of Links (Next <Link> elements) work there, they immediately cause
I don't even know where to start look for this, since app works flawlessly on localhost, but as deployed in Vercel breaks. In Vercel logs, there are no single error, so feels like that's something that happens client side?
EDIT: The weirder this gets, that if I manually go and visit at
Error 500, with following console log:TypeError: e is not iterable
at a (365-d453900cccf7b6ff.js:1:39988)
at e (365-d453900cccf7b6ff.js:1:39753)
at e (365-d453900cccf7b6ff.js:1:39783)
at 365-d453900cccf7b6ff.js:1:64532I don't even know where to start look for this, since app works flawlessly on localhost, but as deployed in Vercel breaks. In Vercel logs, there are no single error, so feels like that's something that happens client side?
EDIT: The weirder this gets, that if I manually go and visit at
/dashboard/profile page, which do have interceptor at /dashboard/@modal/(.)profile/page.tsx, all the links do work after that, as long I dont manually refresh /dashboard page.Answered by Asiatic Lion
Well, answering to myself. After hours of debugging, I finally realized, that maybe it would be good to build and run production build locally, and that was a way get into problem.
When loading page with production build, server gave an error
This made me go through who
As a main takeaway from this. If you run into issues at production but not in local environment, go ahead and run production build locally for better debugging (
When loading page with production build, server gave an error
Error: Unsupported Server Component type: ModuleThis made me go through who
app-directory, and check that none of files there are nothing else than app-router expects. Not sure which one made the trick, but at least now it's working.As a main takeaway from this. If you run into issues at production but not in local environment, go ahead and run production build locally for better debugging (
npm run build & npm run start).1 Reply
Asiatic LionOP
Well, answering to myself. After hours of debugging, I finally realized, that maybe it would be good to build and run production build locally, and that was a way get into problem.
When loading page with production build, server gave an error
This made me go through who
As a main takeaway from this. If you run into issues at production but not in local environment, go ahead and run production build locally for better debugging (
When loading page with production build, server gave an error
Error: Unsupported Server Component type: ModuleThis made me go through who
app-directory, and check that none of files there are nothing else than app-router expects. Not sure which one made the trick, but at least now it's working.As a main takeaway from this. If you run into issues at production but not in local environment, go ahead and run production build locally for better debugging (
npm run build & npm run start).Answer