Deployed functions return 500

Problem:
Even in an empty project with nothing but a single serverless function I cannot get lambda functions to work on the deployed site.

my folder structure is:

serverless
| - .netlify
| - functions
    | - hola
        | - hola.js
| - netlify.toml

This is hola.js (created from the hello netlify template):

// Docs on event and context https://www.netlify.com/docs/functions/#the-handler-method
const handler = async (event) => {
  try {
    const subject = event.queryStringParameters.name || "World";
    return {
      statusCode: 200,
      body: JSON.stringify({ message: `Hello ${subject}` }),
      // // more keys you can return:
      // headers: { "headerName": "headerValue", ... },
      // isBase64Encoded: true,
    };
  } catch (error) {
    return { statusCode: 500, body: error.toString() };
  }
};

module.exports = { handler };

This is the netlify.toml file:

[build]
functions = "functions"

[[redirects]]
from = "/api/*"
to = "/.netlify/functions/:splat"
status = 200

When running ntl dev i have no issues with the function or the redirect.

This project was made from the command line when running ntl deploy --prod for the first time.
Its only when i deploy using ntl deploy or ntl deploy --prod that it completely fails. Attempting to access the function results in a status code of 500.

My netlify project is: https://netnet.netlify.app

The only function is: https://netnet.netlify.app/.netlify/functions/hola

I also have a redirect for the above function (giving the same result though): https://netnet.netlify.app/api/hola

The function logs on the netlify dashboard are blank, containing nothing but a spinning /.

I’ve spent more than a day trying to debug this but I don’t know to proceed. I’m fairly new to Netlify but even after setting up the most barebones configuration I can think of the most basic functions fail without any logs. Please let me know if you have any questions. Any advice on this issue would be greatly appreciated!

I can’t confirm that it won’t happen again but the issue appears be caused by the netlify cli. I really like the cli so i’ll keep checking to see if this is an issue in the future. For the time being im going to stick with repo deploys.

A majority of my deploys up until this point were from the cli tool. After deploying by pushing to the branch the netlify project was watching it was working perfectly without any code changes. The only issue i had from that point on were fixed by removing the package-lock.json and reinstalling after changing from node 15.6.0 to 11.15.0 (this issue was happening locally as well though).

hi @jacob-shuman, please file an issue here:

so we can take a look!