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

    Cоlе

    12/17/2021, 8:50 AM
    thanks again for the help
  • e

    Erwin

    12/17/2021, 8:51 AM
    No worries!
  • e

    Erwin

    12/17/2021, 8:51 AM
    It is surprising how many problems can be solved by ignoring them for a bit 🤣
  • c

    Cоlе

    12/17/2021, 8:51 AM
    no kidding
  • k

    Kev

    12/17/2021, 9:03 AM
    I have the bundled plan for workers, is there a reason those request numbers don't apply to the pages functions call? Can I get more than 100k requests per day somehow?
  • w

    Walshy | Pages

    12/17/2021, 9:04 AM
    Functions count is indeed different. Due to functions being in beta, the current limit is 100k/d but you can request an increase at this form: https://docs.google.com/forms/d/e/1FAIpQLSe4N0BjIxu9AuissCAtYjXUovViXmdx2zopjzASaJi_SImJsw/viewform?usp=send_form
  • x

    xmflsct

    12/17/2021, 1:42 PM
    When developing locally with
    npx wrangler pages dev -- npx gatsby develop
    , the functions route are not captured by workers and instead resulting in Gatsby's 404 pages. How can I solve this issue? Thanks!
  • p

    pxkq

    12/17/2021, 2:37 PM
    Try it with the proxy
  • p

    pxkq

    12/17/2021, 2:37 PM
    npx wrangler pages dev --proxy <gatsby port> -- npx gatsby develop
  • p

    pxkq

    12/17/2021, 2:38 PM
    And connect to wrangler's port, not gatsby's
  • p

    pxkq

    12/17/2021, 2:40 PM
    You can also add
    --port
    to set wrangler's port if you want to chnge the default one
  • x

    xmflsct

    12/17/2021, 3:27 PM
    Thanks, I will have a try right away.
  • x

    xmflsct

    12/17/2021, 3:42 PM
    It works, thanks!
  • x

    xmflsct

    12/17/2021, 5:16 PM
    Another question, how do I provide environment variables when developing locally? It does not seem like grabbing what has been set up in the dashboard.
  • g

    Greg Brimble | Cloudflare Pages

    12/17/2021, 5:23 PM
    No integration between wrangler and what's on production at the moment, so you specify it with
    npx wrangler pages dev ./folder --binding MY_ENV_VAR=somevalue
  • x

    xmflsct

    12/17/2021, 5:27 PM
    Thanks, this is good for now. 🙂
  • l

    Loonb

    12/17/2021, 7:35 PM
    what if the problem persists? Connect to http://127.0.0.1:8788/api/test still results in gatsby 404. any possible issues? the wrangler was install with
    wrangler@alpha
    and the gatsby was freshly created. curious about the hidden problems. Oh ya. the terminal showing:
    Copy code
    TypeError: Web Socket request did not return status 101 Switching Protocols response with Web Socket
        at Server.<anonymous> (file:///D:/projects/my-pages-functions/node_modules/@miniflare/http-server/dist/src/index.js:569:22)
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
  • f

    Fredthedoggy

    12/17/2021, 11:14 PM
    Does miniflare support pages/functions?
  • j

    James

    12/17/2021, 11:14 PM
    wrangler2 does via
    wrangler pages dev
    , which uses miniflare under the hood 😄
  • f

    Fredthedoggy

    12/17/2021, 11:14 PM
    cool
  • j

    James

    12/17/2021, 11:15 PM
    You could do it with Miniflare, but wrangler2 makes that whole experience seamless: https://github.com/cloudflare/wrangler2
  • f

    Fredthedoggy

    12/17/2021, 11:24 PM
    thanks 🙂
  • w

    Walshy | Pages

    12/17/2021, 11:29 PM
    Not sure if there was a new release but the latest pages tag has some more nice things (wrangler@pages)
  • g

    Greg Brimble | Cloudflare Pages

    12/17/2021, 11:59 PM
    We're still figuring out how best to work external Durable Objects into the fold for
    wrangler pages dev
    . This is the current prototype.
  • f

    Fredthedoggy

    12/18/2021, 12:44 AM
    are there any types built into the types package for CF functions?
  • f

    Fredthedoggy

    12/18/2021, 12:45 AM
    specifically the context
  • h

    HardAtWork

    12/18/2021, 12:49 AM
    https://github.com/cloudflare/workers-types/blob/master/manual-ts/pages.d.ts
  • f

    Fredthedoggy

    12/18/2021, 12:49 AM
    thanks 😌
  • f

    Fredthedoggy

    12/18/2021, 12:50 AM
    and my functions just aren't working. how would I debug this?
  • f

    Fredthedoggy

    12/18/2021, 12:50 AM
    I just get a 404
1...454647...392Latest