Skip to content

API routes and getServerSideProps timeout on production (Vercel) #47237

Answered by Pardaramskha
Pardaramskha asked this question in Help
Discussion options

You must be logged in to vote

I GOT IT, I finally understood what was wrong, and it's vicious (and have nothing to do with Next itself, in my case).

The issue came from Material UI, and specifically mui/icons-material.

I mostly used tree-shaking to import icons in my components (i.e. import {AddRounded, Delete} from "@mui/icons-material") but the thing is doing so multiplies bundle size and build time by 5 to 6.

The vicious thing is that, in order to "remove" this abomination, we have to remove every single tree-shaking import from @mui/icons-material from the project, because the bug happens at build time. You can still have icons, but have to import them directly like so:
import AddRounded from "@mui/icons-material/…

Replies: 5 comments 17 replies

Comment options

You must be logged in to vote
6 replies
@icyJoseph
Comment options

@Pardaramskha
Comment options

@icyJoseph
Comment options

@Pardaramskha
Comment options

@Pardaramskha
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
11 replies
@egbadon-victor
Comment options

@msabree
Comment options

@DigitalCreationsCo
Comment options

@stilllovinnero
Comment options

@alshakero
Comment options

Answer selected by Pardaramskha
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet