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

    Erwin

    02/02/2022, 11:40 PM
    I would assume that the file would be generated locally during that? I am not too familiar with exactly how the bundling/compilation happens unfortunately..
  • l

    Lostballoon

    02/02/2022, 11:43 PM
    seems to be doing it in memory, i don't see any files (besides what svelte generates)
  • g

    Greg Brimble | Cloudflare Pages

    02/03/2022, 12:09 AM
    wrangler pages dev
    dumps it to a tmp directory
  • g

    Greg Brimble | Cloudflare Pages

    02/03/2022, 12:10 AM
    wrangler pages functions build
    will generate an
    _worker.js
    in the cwd
  • l

    Lostballoon

    02/03/2022, 1:29 AM
    Thanks
  • m

    marahmanjs

    02/03/2022, 4:37 AM
    i am using functions not workers
  • z

    zsmooth

    02/03/2022, 4:42 AM
    Functions don’t run node either.
  • j

    jaewokim

    02/03/2022, 5:31 AM
    what are the time limits on functions currently, and will it change after the beta?
  • j

    jaewokim

    02/03/2022, 5:32 AM
    My script currently reads from our API server, and that query takes 20~200ms depending on the CF datacenter location
  • h

    HardAtWork

    02/03/2022, 5:51 AM
    The time limits are the same as standard Bundled Workers. You get 50ms of CPU Time, which means that as long as you aren't doing a lot of processing in your Function, you should be fine.
  • j

    jaewokim

    02/03/2022, 5:58 AM
    does the HTTP query time also use up the 50ms limit?
  • j

    jaewokim

    02/03/2022, 5:59 AM
    (querying our API server from functions)
  • h

    HardAtWork

    02/03/2022, 6:07 AM
    Creating the query does, but once the connection is initiated, the counter stops until you receive the response.
  • j

    jaewokim

    02/03/2022, 6:40 AM
    awesome! Thanks 😄
  • p

    pencilflip

    02/03/2022, 4:50 PM
    has anyone run into this on localhost? running
    npx wrangler pages dev
  • p

    pencilflip

    02/03/2022, 4:50 PM
    i get it every OTHER time I refresh, which is very weird
  • p

    pencilflip

    02/03/2022, 5:39 PM
    Also, qq about this: > While still in open beta, there is no additional cost to deploy Functions within a Pages project. However, during beta, there is a total limit of 100,000 invocation requests per day. If you reach your daily limit, Pages will stop executing your Functions and fallback to serving only static assets. to make sure i'm understanding correctly—if the 100k limit is hit, the site won't break right? it'll just stop running the functions code, and instead serve assets as if the functions code didn't exist
  • h

    HardAtWork

    02/03/2022, 5:41 PM
    Yup. The only problem is, some frameworks don’t really have servable static assets, like Remix. So, in that case, your site would break when you hit the limit
  • p

    pencilflip

    02/03/2022, 5:42 PM
    gotcha. for our use case, we're serving a CRA app, and use the cloudflare functions code just to write some custom meta tags. so it seems like even if we hit 100k it won't break
  • h

    HardAtWork

    02/03/2022, 5:45 PM
    So yeah, for now, if it isn’t that important, it is fine. If the execution is mission critical, use Workers until Functions go GA
  • z

    zsmooth

    02/03/2022, 8:50 PM
    If your function is capturing all requests with
    [[path.js]]
    i would make sure to test exactly what happens after you hit 100k requests.
  • e

    Erisa | Support Engineer

    02/03/2022, 8:56 PM
    The behaviour at 100k is to forget about functions and serve the static files as if the functions never existed
  • e

    Erisa | Support Engineer

    02/03/2022, 8:56 PM
    Same behaviour you get when you have no functions directory
  • g

    Greg Brimble | Cloudflare Pages

    02/03/2022, 9:59 PM
    Are you using Remix by chance? Or have you implemented etag/if-none-match headers?
  • z

    zsmooth

    02/03/2022, 10:02 PM
    So if your site is static and the functions provide some additional enhancement, you’re fine. If you’re using remix, your site is down until tomorrow.
  • e

    Erisa | Support Engineer

    02/03/2022, 10:04 PM
    Yes. But for the use-case given above, this is fine.
  • b

    bryan.

    02/04/2022, 3:45 PM
    I'm running into the following error when running
    wrangler
    for my Functions dev environment:
    Copy code
    Error scanning for ports of process with PID 49615: Error: spawnSync /bin/sh ENOBUFS
    Error scanning for ports of process with PID 49616: Error: spawnSync /bin/sh ENOBUFS
    Error scanning for ports of process with PID 49617: Error: spawnSync /bin/sh ENOBUFS
    Could not automatically determine proxy port. Please specify the proxy port with --proxy.
  • b

    bryan.

    02/04/2022, 3:45 PM
    has anyone else run into this and have any suggestions on how to go about resolving it?
  • m

    maximillian

    02/04/2022, 4:27 PM
    Written URLs in my API response are being changed from
    http://
    to
    https://
    ? What's going on? I've read about URL rewriting and URL normalization.
  • m

    maximillian

    02/04/2022, 4:27 PM
    This is using wrangler
1...737475...392Latest