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

    Chinoman10

    12/12/2022, 10:30 AM
    ah, appreciated, thanks ๐Ÿ™
  • d

    DatSparrow

    12/12/2022, 5:54 PM
    Is it exacted behaviour for a deployment's functions tab to look like this with sveltekit and a _worker.js output? I can run wrangler pages deployment tail and it connects, but I get no workers logging output?
  • s

    Skye

    12/12/2022, 5:58 PM
    What's your wrangler version?
  • d

    DatSparrow

    12/12/2022, 5:58 PM
    2.6.1
  • s

    Skye

    12/12/2022, 5:59 PM
    Ok that's definitely new enough that there shouldn't be any issues that I know of ๐Ÿค”
  • n

    Nipsuli

    12/12/2022, 6:02 PM
    Does the pages functions support service bindings locally? As in the docs claims that they do https://developers.cloudflare.com/pages/platform/functions/bindings/#interact-with-your-service-binding-locally but when I do
    npx wrangler pages dev ./public --local --service STUFF=stuff
    I get
    Unknown argument: service
    Copy code
    โฏ npx wrangler version
     โ›…๏ธ wrangler 2.6.2
  • s

    Skye

    12/12/2022, 6:04 PM
    looks like it's wip https://github.com/cloudflare/wrangler2/pull/2162
  • n

    Nipsuli

    12/12/2022, 6:04 PM
    dang, I got too excited ๐Ÿ˜†
  • c

    Chinoman10

    12/12/2022, 6:15 PM
    I made a
    .dev.vars
    file, which I haven't tested yet, but someone mentioned if I put .env vars there, it'll pick it up for the development.
  • c

    Chinoman10

    12/12/2022, 6:17 PM
    Probably dumb question, but how do I upgrade my wrangler? Got 2.1.13 and would like to get up to 2.6.2. I tried with
    npm update (yada yada)
    , even globally on a root folder (no package.json) and it doesn't upgrade versions.
  • c

    Chinoman10

    12/12/2022, 6:17 PM
    I'm having an issue which I suspect is because of this...
  • c

    Chinoman10

    12/12/2022, 6:17 PM
    I have the file...
  • k

    kian

    12/12/2022, 6:18 PM
    should cover it
  • c

    Chinoman10

    12/12/2022, 6:18 PM
    It's running ๐Ÿ‘
  • c

    Chinoman10

    12/12/2022, 6:18 PM
    but I get 404...
  • c

    Chinoman10

    12/12/2022, 6:19 PM
    Already tried all of those.
  • c

    Chinoman10

    12/12/2022, 6:19 PM
    /cc @kian ๐Ÿ‘‡
  • s

    Skye

    12/12/2022, 6:21 PM
    you shouldn't be using it globally, it takes your local version
  • c

    Chinoman10

    12/12/2022, 6:25 PM
    Still happening even after I updated to
    2.6.2
    ...
  • s

    Skye

    12/12/2022, 6:27 PM
    can you share the content of your functions/api/contact-form file?
  • c

    Chinoman10

    12/12/2022, 6:40 PM
    Skye helped me in the DMs (so I could share my file). Wanted to leave a note here. Thanks! ๐Ÿ™
  • j

    JustinNoel

    12/12/2022, 8:22 PM
    Correct. With a
    _worker.js
    for toolsets like Remix, Astro, etc, you won't see the functions in the Function tab in the dashboard. Logs should work fine though from the CLI (you won't get them in the dashboard) Do this in your terminal to see logs for the last preview deployment:
    wrangler pages deployment tail --environment=preview
  • z

    zsmooth

    12/13/2022, 12:07 AM
    Is there any plan to fix this? Been that way for a long time and it seems like a bug
  • b

    bkyerv

    12/13/2022, 5:10 AM
    I am building a pages app using astro and cf functions (mostly for fetching data). I noticed that functions work properly when used on the client (i.e. inside
    script
    tags or components that render on the client) but result in error (500
    failed to parse url
    ) when used on the server (i.e. inside
    ---
    and that gets executed during build stage). Is it normal behaviour? does that mean functions are available only after the build stage?
  • u

    Unsmart | Tech debt

    12/13/2022, 5:27 AM
    Yes that's normal. Functions are only available when deployed.
  • b

    bkyerv

    12/13/2022, 5:56 AM
    and if I want to fetch data during build I would need to set up a full scale worker?
  • u

    Unsmart | Tech debt

    12/13/2022, 6:05 AM
    You can probably just remove the function all together and just fetch whatever data you need in the astro component. ๐Ÿคท
  • b

    bkyerv

    12/13/2022, 6:11 AM
    thank you. understood
  • r

    rain

    12/13/2022, 2:47 PM
    i may be missing something obvious but how do i see a breakdown of what projects are using what amount of functions
  • r

    rain

    12/13/2022, 2:48 PM
    i didnt expect for any of my sites to be using functions (they all should be static, unless sveltekit decided to change its adapter or something)
1...317318319...392Latest