Hi everyone. So I have a NextJS app (<15.0.0) and was trying to deploy to pages. My has both server
Hi everyone. So I have a NextJS app (<15.0.0) and was trying to deploy to pages. My has both server and client functions and is still relatively small. While trying to deploy I see the files in /.next/cache are larger than the 25mb limit. Tried to troubleshoot to optimize where I can (don't have many static assets and they're small). Build direct was set to /.next and npm run build as the command. Am I doing something wrong or is it plainly a matter of refactoring everything to use Cloudflare workers?
17 Replies
I'm still in early stages of Dev and while I have been deploying onto my local server and serving it up that way, thought it would be convenient to test out Pages instead
Subject: Build Failure Due to Bundle Size Limit Exceeded
Hi everyone,
I'm experiencing an issue while deploying my Next.js app on Cloudflare Pages. The build fails with this error:
Earlier in the logs, it mentions:
It seems my bundle size exceeds the 25 MiB limit. Here's a snippet from the build log:
I believe the large number of modules and functions is causing the issue. Does anyone have advice on how to reduce the bundle size or handle this situation? Or how to check bundle size?
Thanks in advance!
Does the new worker's framework platform have support for cron ? If i have a nextjs app deployed can i add a scheduled trigger to the function ?
Does anyone know how to run a cronjob with open-next cloudflare, nextjs 15 ?
Workers with Assets are also able to export a Scheduled Handler for Crons. As for whether
open-next
itself supports it, I am not sureHey guys
Was working on nextjs on CF pages and I always use binding on the API side now I wanted to use on server actions and it is saying
only async function are allowed to be used in use server. File
but the getRequestContext method is not async I think.
Does anyone knows how to use since I kinda need the bindings to work.Generated Pages Functions bundle size (26282201) is over the limit of 25.0 MiB
Failed: generating Pages Functions failed. Check the logs above for more information. If this continues for an unknown reason, contact support: https://cfl.re/3WgEyrH
How to check bundle side? How to understand which file is causing this?
Remove the
export const runtime = "edge"
. It is not needed in use server filesIt is needed for any server side code. The issue is with the context which is a sync function and all server actions functions must be async
No it's not, the error is clearly highlighting that line. I use server actions too and can confirm that the runtime option is unavailable/not needed. Do ensure that you have it in your root layout or in single pages, tho
Also, about the context, you're calling
getRequestContext()
inside an async function so it's totally fineHeya, can you open an issue on the opennext-cloudflare repo for cron support
The problem is that you're exporting the runtime from an action file. Actions don't need that. You only need to export the runtime from either a layout or a page file
Sure šš»
Hi everyone, my CF builds for next.js just stopped with a message
and nothing has changed in the config, I am not using the not found page it is auto-generated. Has anyone experienced similar?
UPDATE: Just fixed by itself after some time, really strange š
Sounds like a Next.js issue
I'm aware that the edge runtime builds as required/requested or something like that but I was wondering request times should by in the 6-8s realm?
Sounds odd. Maybe it's network requests inside the app or very large component trees?
I do have an API it calls that does roughly take 6s but I have a skeleton UI that should display whilst it's doing so. It functions as intended with the skeleton UI when I'm testing locally.
Unknown Userā¢2w ago
Message Not Public
Sign In & Join Server To View