Hi,
I’m having problems deploying my app to the production site (staging seems to work just fine) since I introduced a test scheduled api route to my next.js application:
import { NextApiRequest, NextApiResponse } from "next";
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
// Do something scheduled
console.log("Scheduled API called", req);
return res.status(200).send("OK");
};
export default handler;
export const config = {
type: "experimental-scheduled",
schedule: "0 */10 * ? * *", //"5 3 * * *" // Every day at 03:05
};
The error I am getting is all the way at the end of the deploy step (see log in attachment):
Could not create scheduled functions: Fields missing or invalid: functions[0].cron
On my staging branch deploys this works just fine (allthough the scheduled api route is not called as is stated in the documentation).
I also got the same error when using seperate (regular) scheduled functions, so I don’t think it is next.js related.
Netlify site name: plutus-pos.netlify.app