https://discord.cloudflare.com logo
Join Discord
Powered by
# functions
  • h

    HardAtWork

    02/13/2023, 10:39 PM
    As in, just like Pages Functions, they may appear to be separate, but in the end, they are just bundled together
  • i

    izznatsir

    02/13/2023, 10:42 PM
    So the limits here https://vercel.com/docs/concepts/functions/edge-functions/limitations#code-size-limit accounts for all edge functions combined? Not one function file?
  • u

    Unsmart | Tech debt

    02/13/2023, 10:43 PM
    Probably but you'd have to ask them for confirmation
  • i

    izznatsir

    02/13/2023, 10:43 PM
    But it seems not to be the case, both next.js and SvelteKit support splitting their routes to be one edge function per route.
  • h

    HardAtWork

    02/13/2023, 10:44 PM
    How can you tell if they are each a separate route, or just one big one?
  • u

    Unsmart | Tech debt

    02/13/2023, 10:44 PM
    I assume they get bundled at build/upload time not at dev time
  • i

    izznatsir

    02/13/2023, 10:44 PM
    I look at the build output
  • u

    Unsmart | Tech debt

    02/13/2023, 10:45 PM
    You cant view what they do at the upload time though
  • u

    Unsmart | Tech debt

    02/13/2023, 10:46 PM
    Like I can have many function defined on pages too and I cant actually see that at upload time its combined but I know it is
  • i

    izznatsir

    02/13/2023, 10:46 PM
    Yeah sure I have to confirm my assumptions, but it would be nice if pages function files is treated as separate worker for each
  • i

    izznatsir

    02/13/2023, 10:47 PM
    This is my point, regardless whether vercel edge supports it or not
  • h

    HardAtWork

    02/13/2023, 10:48 PM
    The issue there is that there is a tangible price for CF to do that. Each script is a separate value, which depending on your pricing tier, may be stored in a large amount of datacenters, so it makes sense to compress it as much as possible
  • i

    izznatsir

    02/13/2023, 10:51 PM
    Make sense. But it also true that by removing that limitation, pages function will be more scaleable for full stack web apps use cases. Just my wish though.
  • i

    izznatsir

    02/13/2023, 10:52 PM
    Thanks for the quick responses!
  • u

    Unsmart | Tech debt

    02/13/2023, 10:52 PM
    5MB after minification and compression would be an absolutely giant site
  • u

    Unsmart | Tech debt

    02/13/2023, 10:54 PM
    Especially given that static assets/routes wont be included in that 5MB
  • p

    Ping for toast

    02/14/2023, 2:15 AM
    Is it possible to make a function only run against HTML pages? I have a HTML rewriter, and — correct me if I'm wrong — requests to things like scripts count against the limit and increase (even microscopically) latency
  • j

    James

    02/14/2023, 3:26 AM
    You can run Functions on specific paths and things like that with _routes: https://developers.cloudflare.com/pages/platform/functions/routing/#create-a-_routesjson-file
  • j

    James

    02/14/2023, 3:26 AM
    But yes, if it runs at all, that counts as an invocation.
  • p

    Ping for toast

    02/14/2023, 3:26 AM
    I could just exclude the static folders I guess
  • p

    Ping for toast

    02/14/2023, 3:27 AM
    doesn't fully solve the problem, not everything static is actually served from there
  • p

    Ping for toast

    02/14/2023, 3:27 AM
    but
  • s

    sean

    02/15/2023, 6:33 AM
    Hey there - I've set up Cloudflare Pages with Nextjs and it's working wonderfully. Anyone here have solutions to view the logs of my functions? Maybe implementing some third party monitoring software, etc?
  • s

    sean

    02/15/2023, 6:34 AM
    It would be amazing if someone has a repo that I can have a look at. From my understanding, CF does not have any available features now to monitor.
  • s

    sean

    02/15/2023, 6:40 AM
    Something with Sentry, Rollbar, etc? I'm okay with paid solutions as long as it's less than $100 a month
  • h

    HardAtWork

    02/15/2023, 6:41 AM
    You could use https://www.npmjs.com/package/toucan-js if you want to use Sentry?
  • j

    JustinNoel

    02/15/2023, 1:25 PM
    I have some custom middleware (using Hono) to send me logs to Logflare (owned by Supabase). It's just $9/mo. Logflare is great for live monitorning. Historical logs can be saved to Google's BigQuery and mined extensively. You might want to check out CF's Log Engine too. https://blog.cloudflare.com/announcing-logs-engine/
  • z

    zsmooth

    02/15/2023, 6:23 PM
    My Pages (functions) site just started returning
    Copy code
    Error 1104 Ray ID: 79a012098cdf2806 • 2023-02-15 18:22:42 UTC
    Script not found
    - any idea what could cause that? I hadn't done any new deployments or anything.
  • z

    zsmooth

    02/15/2023, 6:31 PM
    (I get nothing in function logs)
  • u

    Unsmart | Tech debt

    02/15/2023, 6:34 PM
    weird 🤔 cc: @Walshy | Pages ?
1...344345346...392Latest