You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. So I'm using scheduled functions and along with the dev env/mode it's working fine, I can serve it and invoke it. But as long I'm putting this to the server I have this error:
The package is defined as a dependency in the package.json, and this is my function:
const{ schedule }=require('@netlify/functions')exports.handler=schedule('@hourly',async(event)=>{consteventBody=JSON.parse(event.body)console.log(`Next function run at ${eventBody.next_run}.`)// function initreturn{statusCode: 200,}})
Hi @lukasborawski! I can't find anything obviously wrong with the code you shared, so I wonder if you could share a repository that we could use to reproduce the problem?
Hi @eduardoboucas So I've moved this function to the codebase, and even though I have some undefined errors.
[SyntaxError] - Unexpected end of JSON input
Locally it works fine. How can I debug this locally, and try it with the same environment as on the server? Or how to get some more detailed logs from the server?
Hello. So I'm using scheduled functions and along with the dev env/mode it's working fine, I can serve it and invoke it. But as long I'm putting this to the server I have this error:
The package is defined as a dependency in the
package.json
, and this is my function:Netlify config:
Functions are enabled on the Labs and Project page. What is wrong? Thanks for the help in advance.
The text was updated successfully, but these errors were encountered: