Netlify functions not deploying to live site?

My functions do not seem to be deploying to my live site - if you check the console, you’ll see the 404.

Running locally using netlify dev, they work fine.

My netlify.toml is as follows;

[build]
  command = "npm run build"
  functions = "./lambda"
  publish = "public"

My folder structure has the code in src/lambda but builds to lambda in project root.

My dashboard reports usage;

…but my functions tab is blank?

Anyone see what I’m missing here? :face_with_monocle:

Hey @barrymcgee,
First of all, thank you for dropping my favorite emoji :face_with_monocle::face_with_monocle::face_with_monocle:

To the important stuff: It seems like your functions were working at one point, but broke somewhere along the way. Do you remember approximately when they stopped working? It would definitely be helpful for us to dig into those specific deploys. Maybe here?

Since the previous deploy shows several zip-it-and-ship-it function logs, while this one does not + shows function errors.

The functions UI does show that you don’t currently have any functions in production. This would align with what you’re saying about your functions not deploying.
But digging into the Apr 21 through May 21 usage, it seems like you have had several deploys where you successfully uploaded functions. This is from May 3:

Maybe we need a feature request for some kind of badge when functions fail but the build succeeds…

1 Like

Thanks to your steer, I can also drop mine - :raised_hands:t2:- as my functions are now working again!

Outlining process for others…

  • I figured that when functions build successfully, the deploy logs include the line item Prepping functions with zip-it-and-ship-it
  • I then manually bisected my deploy logs until I found the first log which didn’t include the line item above and investigated that changeset
  • There, I found a change I have made in one of my functions where I used optional chaining which I assume is not yet supported by the version of node used by these functions
  • Reverting that change fixed my issue :raised_hands:t2:
1 Like

Awesome, glad to hear you’re up and running + thanks for the summary :muscle:

1 Like