Next js build error on cloudflare pages. Error: Asset "/opt/buildhome/repo/.next/cache/webpack/server-production/0.pack" is over the 25MB limit. Size: 27332699 bytes

I am seeing an error when trying to build Nextjs app on cloudflare pages. Not sure how to fix this error as it relates to the build.

Error: Asset “/opt/buildhome/repo/.next/cache/webpack/server-production/0.pack” is over the 25MB limit. Size: 27332699 bytes

What did you set your build output to?

I think it is .next directory

I am also running next build for the build command

You should be running next build && next export and have your public folder set to out

I was having problems with dynamic routes. Thats why I changed it.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.