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

    Helpflare

    01/05/2023, 1:58 PM
    I will remind you in 6 hours at Jan 5, 2023 at 19:58 GMT
  • a

    aniash29

    01/05/2023, 3:47 PM
    Hey Guys! Looking for help here. Do send me in the right direction if this is not the right place to chime in with this: Have been running an app on Pages. Was all good until the deployment today. With this deployment, got an error about wrangler not being able to locate 'functions' dir in the project which is kind of weird. Tried to look at different places to see what could it specifically be but no help. My project contains a functions dir from very beginning and all has been well until today. This is the exact message in logs: Warning: Wrangler did not find routes when building functions. Skipping.
  • k

    kian

    01/05/2023, 4:05 PM
    What does your functions directory look like and what's in the .js/.ts files?
  • a

    aniash29

    01/05/2023, 4:07 PM
    Just runs Firebase functions/calls (admin)
  • a

    aniash29

    01/05/2023, 4:28 PM
    though nothing was really changed in the functions/index.js file. Just he deployment throws error this time.
  • s

    Skye

    01/05/2023, 4:33 PM
    Wrangler gives you that warning when it detects a folder called "functions" which has no pages functions in it
  • s

    Skye

    01/05/2023, 4:33 PM
    If you're expecting that, you can safely ignore the warning
  • a

    aniash29

    01/05/2023, 4:36 PM
    This is what the log shows.
  • s

    Skye

    01/05/2023, 4:37 PM
    If you're expecting your folder to have no functions, you can safely ignore the warning
  • s

    Skye

    01/05/2023, 4:37 PM
    I see your site is still deploying fine
  • a

    aniash29

    01/05/2023, 4:38 PM
    yep, but the folder has functions. And everything static is indeed working fine. But my Firebase admin calls would fail since the functions didn't dep;oy
  • a

    aniash29

    01/05/2023, 4:39 PM
    functions/index.js in the project includes all Firebase admin calls related to app functionality
  • j

    James

    01/05/2023, 4:39 PM
    I think you're hitting this bug: https://github.com/cloudflare/wrangler2/issues/2240
  • a

    aniash29

    01/05/2023, 4:47 PM
    I'm not sure. However, if I understand correctly and if what deployment throws is a warning and not an error, it was generated because I only have index.js inside my function dir and no real routes?
  • s

    Skye

    01/05/2023, 4:47 PM
    Correct. The functions directory is reserved for pages' functions
  • s

    Skye

    01/05/2023, 4:47 PM
    So if you have anything else in there, it isn't uploaded and can cause issues
  • a

    aniash29

    01/05/2023, 4:48 PM
    Hmm. I will take a look again. Thanks for insight, guys! Appreciate it.
  • j

    Jacked

    01/05/2023, 6:46 PM
    Are Functions deployed on the global edge network like workers?
  • s

    Skye

    01/05/2023, 6:47 PM
    Functions are workers
  • c

    Chaika

    01/05/2023, 6:47 PM
    Functions are Workers with a few syntax/setup differences
  • j

    Jacked

    01/05/2023, 6:48 PM
    Okay, thank you
  • h

    Helpflare

    01/05/2023, 7:58 PM
    Reminder for @User: functions docs issue package.json Set
  • d

    dant

    01/06/2023, 6:46 AM
    Do pages functions support files in request.formData() properly? I've set the compatibility date 2022-11-30 in the online config and in dev at the command line, but keep getting errors trying to access a File. Is there something else that I need to do?
  • w

    Walshy | Pages

    01/06/2023, 8:36 AM
    Code?
  • d

    denniarems

    01/06/2023, 12:45 PM
    i want to install with pnpm,but when deploying it exited with npm install error. then its not continuing the process
  • w

    Walshy | Pages

    01/06/2023, 12:48 PM
    logs?
  • w

    Walshy | Pages

    01/06/2023, 12:48 PM
    error?
  • d

    denniarems

    01/06/2023, 12:53 PM
    i just want to skip the npm installation, with pnpm its working fine
  • w

    Walshy | Pages

    01/06/2023, 12:58 PM
    that's only half an error but either way, did you do as Vero said?
  • d

    denniarems

    01/06/2023, 1:05 PM
    without doing a package.json how to do that ?
1...325326327...392Latest