fab: Next + Cloudflare Workers Script Too Large

Hello, I am new to Fab and trying to deploy a stock Next.js site to Cloudflare workers. However I am getting a workers.api.error.script_too_large error when deploying.

From what I can tell the server.js file is not being minified. Is this supposed to happen automatically or have I missed something in the configuration?

Thanks for the help.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (11 by maintainers)

Most upvoted comments

Alright, I’ve added the minify option properly, it should be available under:

yarn add https://pkg.csb.dev/fab-spec/fab/commit/b68a4a33/@fab/actions https://pkg.csb.dev/fab-spec/fab/commit/b68a4a33/@fab/cli
fab build --minify

Now looking at why NextJS got so chonky recently. Lockdown’s been tough on us all, I suppose…

So I guess this is still an issue… I just discovered this project (it sounds really great!) but I actually can’t do the Getting Started Guide with NextJS with zero modifications and deploy to Cloudflare.

The minify flag reduced from 1.7MB to 1.3MB but still not under and I haven’t even made modifications yet.

Kinda a bummer because NextJS seems like a great full featured project. Maybe I should try something else? I am interested in FAB project + Cloudflare workers because it seems like a great combo for super low latency sites.

Edit: Oh, I see #259 I didnt see it earlier 👌

Looks like you should be able to do yarn add https://pkg.csb.dev/fab-spec/fab/commit/d541aa94/@fab/input-nextjs and rebuild. I don’t think it’ll be any smaller but there was definitely some weird behaviour there that I’ve fixed, so it’d be good to double-check that everything still works.

Whoa that’s… bigger than I thought. Ok, I’m adding a minify flag for now so you can keep going, but I have a couple of NextJS things to look into that are bubbling to the top of my list anyway, so will loop this in too.