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

    Walshy | Pages

    12/23/2022, 6:28 PM
    ^
  • w

    Walshy | Pages

    12/23/2022, 6:28 PM
    You could also just
    import
    it
  • t

    tuf

    12/23/2022, 6:32 PM
    I'm a bit confused by
    uploaded assets
    , does it mean assets (files) deployed to pages or something else I'm missing
  • s

    Skye

    12/23/2022, 6:33 PM
    Yes, they have to end up in your output folder
  • t

    tuf

    12/23/2022, 6:34 PM
    Is there any way to see the contents of output folder
  • s

    Skye

    12/23/2022, 6:37 PM
    That depends on if you're using a framework or not
  • t

    tuf

    12/23/2022, 6:50 PM
    No framework
  • s

    Skye

    12/23/2022, 6:54 PM
    Then it's just the folder normal folder where your files that you want to be uploaded are stored
  • l

    Larry

    12/23/2022, 8:11 PM
    I asked this a few days ago and got no answer, but does anyone have an example of successfully using
    wrangler pages dev
    to do local debugging with Durable Objects?
  • n

    nipperstick

    12/24/2022, 12:31 PM
    Need moar brainpower pls. My function works locally (using worker pages dev), but fails when deployed. I have tested to ensure the environment vars are present and correct. The bit below throws
    Copy code
    TypeError: Fetch API cannot load
    , but again - only when deployed.
    Copy code
    const res = await fetch(url, {
              method: "POST",
              headers: { 
                "Content-Type": "application/json",
                "AuthorizationSource": "API",
                "Authorization": `Basic ${apiKey}`
              },
              body: JSON.stringify({ query, variables })
        })
    The fact that this is a network-level exception in fetch makes this hard to troubleshoot. I can't figure out how to get more detail.
  • s

    Skye

    12/24/2022, 12:33 PM
    What's the URL you're trying to fetch?
  • n

    nipperstick

    12/24/2022, 12:34 PM
    Copy code
    https://staging-api.gethealthie.com/graphql
  • s

    Skye

    12/24/2022, 12:35 PM
    Ok so you're not trying to fetch a specific port or anything, that's fine
  • s

    Skye

    12/24/2022, 12:36 PM
    It looks like you've cut off some of the error message?
  • n

    nipperstick

    12/24/2022, 12:36 PM
    I've run locally using both dev and built scenarios (wrangler pages dev -- yarn dev, wrangler pages dev -- yarn start essentially)
  • n

    nipperstick

    12/24/2022, 12:36 PM
    The entire error reads:
    Copy code
    TypeError: Fetch API cannot load:  https://staging-api.gethealthie.com/graphql
  • s

    Skye

    12/24/2022, 12:37 PM
    There's typically a reason that comes just after the URL 🤔
  • n

    nipperstick

    12/24/2022, 12:37 PM
    Nothing, nada, alas
  • s

    Skye

    12/24/2022, 12:40 PM
    Doing some searching at the moment, but everything looks like it should work
  • y

    Yuu

    12/25/2022, 7:19 PM
    I have a pages project with a custom domain (example.com). This project handles everything except one route, /xyz /xyz is handled using a workers. The worker project does not have a custom domain and instead uses Routes to pass the request. Am I doing this right? Is functions different? I don't really see how they differ from a quick look at the docs
  • y

    Yuu

    12/25/2022, 7:19 PM
    Note that the worker is written in Rust with #882757739019911219
  • y

    Yuu

    12/25/2022, 7:27 PM
    (please ping me when responding)
  • t

    TL&D

    12/28/2022, 4:02 AM
    My site, created using cloudflare pages functions, keeps seeing this error. If you request again a few minutes after the request, it appears normally, but if you do not request it and then do it again, the same problem occurs again. However, in cloudflare pages functions, nothing is output when the log stream is activated.
  • i

    Ishan

    12/28/2022, 7:07 AM
    Hey just wanted to know that is supporting wasm planned for functions in the future?
  • w

    Walshy | Pages

    12/28/2022, 11:19 AM
    Yes
  • w

    Walshy | Pages

    12/28/2022, 11:19 AM
    Tailing is gonna be your best insight here. Enable and wait a minute, it can take a little bit of time for the logs to come through
  • t

    TL&D

    12/28/2022, 11:22 AM
    It hasn't come up for 14 days
  • c

    CandyViz

    12/28/2022, 1:20 PM
    Now that functions is GA has anyone used image resizing in a function request? I can get the image resizing (
    options.cf.image.height
    ,
    options.cf.image.background
    ,etc) to work in a plain worker but not in a pages function.
  • c

    CandyViz

    12/28/2022, 6:21 PM
    I guess I could create a service binding to call a worker from the function so the worker can add the options objects to a fetch request to the image to reqize but it seem like since functions are just workers under the hood that I should be able to just use the same functionality I can in a worker, in a function. I've been struggling with this for a a few months and had figured it would be resolved when functions were released GA but I now thing I may just be missing some configuration somewhere.
  • v

    Vero 🐙

    12/29/2022, 5:45 PM
    Hi @CandyViz image resizing isn’t available in Functions right now.
1...322323324...392Latest