diff --git a/src/commands/logs/functions.mts b/src/commands/logs/functions.mts index 68b0c3a8676..d8080d8b5fc 100644 --- a/src/commands/logs/functions.mts +++ b/src/commands/logs/functions.mts @@ -30,7 +30,12 @@ const logsFunction = async (functionName: string | undefined, options: OptionVal const { site } = command.netlify const { id: siteId } = site - const { functions } = await client.searchSiteFunctions({ siteId }) + const { functions = [] } = await client.searchSiteFunctions({ siteId }) + + if (functions.length === 0) { + log(`No functions found for the site`) + return + } let selectedFunction if (functionName) {