Next.js Discord

Discord Forum

Nextjs @next/mdx doesnt work in production, but works locally

Unanswered
Rough harvester ant posted this in #help-forum
Open in Discord
Rough harvester antOP
I'm running into an issue with no appearent reason, I am first time using mdx from a tailwindui project, I've added localization and all but made it work locally, with dev mode and build mode, yet when I go to the site on vercel it doesnt display the blogs/mdx files. Why can that be?

33 Replies

Rough harvester antOP
do ping me if you are here please, I will provide any info necessary with which you might be able to help
English Setter
@Rough harvester ant Did you inspect the runtime logs on Vercel? it might give you a clue

also what are your SSR settings?
@English Setter <@942468825117519922> Did you inspect the runtime logs on Vercel? it might give you a clue also what are your SSR settings?
Rough harvester antOP
I'll inspect the runtime logs, ssr, not sure as this isnt my from scratch project
runtime logs say all is good, not a single error or warning
same with build logs
English Setter
Rough harvester antOP
Hmm, never touched that, so I am assuming auto
you think that could help? changing what it should use as runtime?
English Setter
my haunch is that it should all be static, as trying to bundle things at runtime usually throws a write permisstion error, that's why I asked for runtime logs
Rough harvester antOP
it should be as I am also using next-i18n package that makes it all static, other than functions
runtime doesnt show anything wrong
to be fair I dont get any errors warning or anything locally either, but it works locally
@Rough harvester ant to be fair I dont get any errors warning or anything locally either, but it works locally
English Setter
Yeah, I've had a similar issue this week. You can simualte a read only fs locally with:
npm run build && chmod 555 -R .next
Rough harvester antOP
okay lets try
what solved your issue?
@Rough harvester ant what solved your issue?
English Setter
well, I introduced it when I tried to tweak those settings, but again your issue might be different
Rough harvester antOP
ahh
yeah still no clue
English Setter
What does the web page show? console output?
Rough harvester antOP
whats even weirder is that the pages actually show
here let me show you
no console output btw
those arent showing and I have absolutely no clue why
on the actually pathnames they're there and working
English Setter
I gotta run in a few minutes
Rough harvester antOP
nothing worked
I have no fucking idea whats wrong
Rough harvester antOP
so I tracked the issue down to it being a server file serving issue, no clue how to fix it or why its happening yet just that that's it. its appearent in how the next/vercel serves files that get fetched on the server side is where the issue is at, do you know what it could be? @English Setter
English Setter
DM me