Published Netlify functions disappear?

Hi, there—recently I’ve discovered that my .netlify functions no longer exist when published to Netlify—I get a 404 error. The actual path is https://dev--fusion-club.netlify.com/.netlify/functions/getCustomer and should actually get a 401 error since there are no credentials to pass into the call (those are stored in the env variables so when called from the site properly should actually fire correctly—and has, previously).

When I serve and build locally, there’s no issue. It had been working on Netlify I would say about several weeks ago to my recollection. Does this have anything to do with the recent Node 8 deprecation since my functions are Node-based? There are no errors reported in the build log.

Hmm, I see what you are seeing. The intention is not that the function would stop working with the deprecation, but I’m not 100% sure if that change might be related or not. I don’t see the redirect rule for functions at all on that dev branch deploy, somehow.

I’m the only one working today, but I’ve asked my teammates to work with our platform team to debug this once they’re back in the office tomorrow. Could you in the meantime try spinning the function up on a separate deploy (maybe on a different site or branch?) to see if we can get a working deploy to compare to?

Sorry to hear that you’re holding down the fort, @fool. I appreciate the reply. I did a quick deploy on another branch. URL is https://debug--fusion-club.netlify.com/. The only difference was adding my /lambda directory back to .gitignore. I had removed it earlier in hopes it made a difference. Sadly, it does not appear so. When it was working (and even now), my netlify.toml uses:

[build]
  functions = "lambda"
  command = "yarn build && yarn build:lambda"

edit: the original command was actually npm build && npm build:lambda
(I didn’t think it made any difference changing it to yarn which is what I use locally anyways.)

Let me know if you need any supporting files like my package.json

If it makes any difference, the site is a gatsby build. Thanks, Chris.

Issue is at my end. API changes were made that weren’t updated in the env settings. The 404 error was due to the change in API and not unavailability of the function—it was hard to determine that because I can’t see the folders deployed. Closing this.

Thank you for the follow-up and sharing this additional information, @vict-r. This is very helpful and we appreciate you taking the time to update this topic with these details.

Hey, @luke. No worries. This does bring up a UX issue, though, about the env settings. Longer URLs are difficult to discern. When you open them up, they are single-line, truncated and, when you edit them, each line is in a single scrollable input field.

It’s not an issue when your endpoints are short and compact but from my own experience they generally are not.

I hope you can file this as a nice-to-have UX change request.

cheers!
—Victor