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

    Skye

    12/10/2022, 2:52 PM
    I would note this though - it seems they only offer a subset of functionality
  • k

    konrad1221

    12/10/2022, 3:06 PM
    Looks like, thanks for the help with the error, it was not intuitive for me at a glance to look into next-auth. It looks like next-auth issues was already discussed on CF discord. I will check other messages. Thanks!
  • c

    Cоlе

    12/10/2022, 9:15 PM
    Has anyone had any luck using gitpkg.now.sh or NPM aliases (
    npm install @sveltejs/kit@npm:@my-package/kit -D
    )? I've been trying to get my fork of sveltekit to build on Cloudflare, I just get
    Cannot find package '@sveltejs/kit' imported from /opt/buildhome/repo/...
    from the build log. Has anyone ran into anything like this before?
  • c

    Chinoman10

    12/10/2022, 10:22 PM

    https://media.discordapp.net/attachments/647508232272871448/1051235306512334868/image.png▾

    How can I use an Env. Variable/Secret when it's "declared globally" (according to CF Docs)? It's not declared within the code (even if I create a
    .env
    file with the var inside it doesn't do anything), so Typescript is erroring out... I know this is very much a rookie thing, but I'd appreciate any help 😅🙏
  • z

    zszszsz

    12/11/2022, 1:27 AM
    Does page functions support arbitrary string as method ? I am planning about the HTTP QUERY method
  • j

    James

    12/11/2022, 1:28 AM
    I don't believe so. You could try a generic
    onRequest
    method though, and then manually check the method yourself 🤔 https://developers.cloudflare.com/pages/platform/functions/api-reference/
  • j

    James

    12/11/2022, 1:30 AM
    (testing now)
  • z

    zszszsz

    12/11/2022, 1:31 AM
    fetch says 400 Bad request I am not sure it is chrome or wrangler
  • j

    James

    12/11/2022, 1:35 AM
    Doesn't seem like it works unfortunately. I get a 501 with
    curl -IX QUERY https://method-test.pages.dev/method
    but standard methods work
  • z

    zszszsz

    12/11/2022, 1:36 AM
    I get a 400 with curl too
  • w

    Walshy | Pages

    12/11/2022, 1:52 AM
    You really should stick to standard methods
  • w

    Walshy | Pages

    12/11/2022, 1:54 AM
    onRequest should work afaik but yeah, I'd stick to standard methods
  • z

    zszszsz

    12/11/2022, 4:17 AM
    It can do WebDAV methods though. SEARCH works.
  • t

    TL&D

    12/11/2022, 12:04 PM
    I distributed nuxt3 to functions through github connection, which folder should I use instead of dist?
  • c

    Caps

    12/11/2022, 1:47 PM
    Hi all! I've got a static Pages site running, where one page has a that gets data from an external api and rewrites an html table with that data. Is it possible to move that script to a function? Sorry if it's a dumb question but I don't really know web development
  • w

    Walshy | Pages

    12/11/2022, 2:17 PM
    yeah for sure
  • w

    Walshy | Pages

    12/11/2022, 2:17 PM
    fetch + should do you good
  • c

    Caps

    12/11/2022, 2:41 PM
    Thanks! Are workers and functions the same thing? At first I thought I'd be able to just replace the content in the to GET /myfunc.js (which would have the benefit of hiding an api key)
  • h

    HardAtWork

    12/11/2022, 2:42 PM
    Functions are Workers tied in to Pages. They are usually a few versions behind, in terms of support for new bindings/features.
  • c

    Caps

    12/11/2022, 2:43 PM
    So in this case I'd be using a worker, not a function. Which matters for the documentation i need to read
  • h

    HardAtWork

    12/11/2022, 2:44 PM
    If you are deploying it completely separately, it is a Worker. If it is in your Pages directory, it is a Function. Also, most of the base APIs, such as HTMLRewriter, are present in both.
  • c

    Caps

    12/11/2022, 2:45 PM
    Oh, I think i get it. Thanks
  • w

    Walshy | Pages

    12/11/2022, 2:54 PM
    Yes Functions are Workers
  • z

    zszszsz

    12/11/2022, 11:09 PM
    Is the total request count showing in pages panel accurate ? I am sure I did more that it shows.
  • w

    Walshy | Pages

    12/11/2022, 11:16 PM
    it may be a little behind but should be relatively accurate
  • p

    Probert

    12/12/2022, 9:27 AM
    Is there a way to debug my function startup time?
  • c

    Chinoman10

    12/12/2022, 10:23 AM
    bump... 😅 🙏
  • h

    HardAtWork

    12/12/2022, 10:25 AM
    Environment Variables aren't global in the module syntax. They are provided on the
    env
    object in the handler.
  • p

    Probert

    12/12/2022, 10:25 AM
    Pages functions are module workers, which means any env variables should be accessed as bindings: https://developers.cloudflare.com/pages/platform/functions/bindings/
  • h

    HardAtWork

    12/12/2022, 10:25 AM
    Oh, it's Pages
1...316317318...392Latest