Issue with function in subdirectory

I’ve got a function that’s in the subdirectory (the CLI scaffolded it there) and I’m noticing on build (where I run netlify-lambda build functions that the function in the subdirectory isn’t picked up. Should it be? If not, why does the CLI scaffold it in a subdirectory?

Ok, so apparently this is expected: https://github.com/netlify/netlify-lambda/issues/90.

But why does the netlify CLI scaffold into a subdirectory?

Wait - again. :slight_smile: So when I ran netlify dev, my function worked just fine in a subdirectory. So how do I get my production build to work as well?

To be clear, my code is in functions/newsletter-signup/newsletter-signup.js.

When running netlify dev, I can hit it at http://localhost:8888/.netlify/functions/newsletter-signup. Trying the same in production results in a 404 and as I said, in the deploy logs I don’t see it picking up the function. Nor do I see it in the Functions tab.

Sigh - and again - this was my fault. I had a setting in netlify.toml that I did NOT commit to GitHub so it worked locally, but not in production. Dangit Netlify can’t you do what I want and not what I type? :wink:

Hi @cfjedimaster - thanks for being SO GOOD at coming back and resolving your own tickets :smiley: :+1:

Sorry it keeps being tricky. I’m going to leave this thread here as a thought train for anyone who migh find it useful when they debug in the future too :slight_smile: