cache/webpack/server-production/0.pack too big but can't see why

Hello, apologies for the perhaps silly question, but I've looked around and gone in circles with claude with no success. I have a very simply nextjs webapp that I want to deploy on pages. When I run bundle analyze, it gives me about 1MB for client, 3MB for nodejs, and 250KB for edge. it runs perfect locally. And yet when I try and build, it gets to the very last step and says: 23:11:46.407 ✘ [ERROR] Error: Pages only supports files up to 25 MiB in size 23:11:46.407
23:11:46.407 cache/webpack/client-production/0.pack is 42.3 MiB in size I'm relatively new to nextjs for context, but I don't understand why there is such a large discrepancy, nor do I understand where I can investigate more about it. Claude is suggesting duplicate imports and for me to dynamic import my large components, but it makes no sense given that my entire webapp consists of a sidebar, 4 empty pages, and a 5th page with a table and some input fields. There are no graphic, no long essays, all data is fetched from supabase... any help would be greatly appreciated, thank you for taking your time
1 Reply
smallgreenmen
smallgreenmenOP7d ago
I wanted to return to this and mark it as solved as well as state what I changed: initially Claude had suggested some (in retrospect) wack configurations with "npm run build" as the build command and .next or something as the output directory. That didn't work. What ended up working at the end was using the configuration options that cloudflare recommended from the start! Hahahaha. Hope this helps someone someday

Did you find this page helpful?