cli icon indicating copy to clipboard operation
cli copied to clipboard

Scheduled functions are not running with Nextjs SSR app

Open teddybee opened this issue 2 years ago • 4 comments

Describe the bug

When I uploaded my nextjs project via CLI, the scheduled netlify functions are simply not firing. I couldn`t see any schedule badge on the project admin console. I can see the uploaded function and can run with the url by hand. I have tried set it in the .toml file and in the function handler as well. If I upload the function without the nextjs project, it is working.

Steps to reproduce

1: clone this project: https://github.com/netlify-templates/next-netlify-starter 2: yarn install 3: make some netlify function 4: set the scheduler for the function 5: netlify deploy --prod

P.S: The nextjs app itself will also failes: 404 ["page not found"]

Configuration

[build] command = "yarn build" publish = ".next"

[[plugins]] package = "@netlify/plugin-nextjs"

[functions."forecast-poll"] schedule = "@hourly"

Environment

System: OS: Windows 10 10.0.22000 CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700K Memory: 19.50 GB / 31.79 GB Binaries: Node: 16.15.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.13.1 - C:\Program Files\nodejs\npm.CMD

"@netlify/functions": "^1.0.0", "@netlify/plugin-nextjs": "^4.9.3",

teddybee avatar Jun 28 '22 22:06 teddybee

I also ran into this bug. A workaround that worked for me was scheduling it inline instead of using the netlify.toml file.

aileen avatar Aug 18 '22 09:08 aileen

Unfortunately, that's not working for me eighter. Even if I build, deploy from linux(WSL), I still don`t see any scheduling information on the web admin page. Not firing events on its own.

teddybee avatar Aug 18 '22 12:08 teddybee

@teddybee have you activated scheduled functions in the Netlify Labs section in your settings?

minivan avatar Sep 20 '22 09:09 minivan

@minivan No... Thank you for your help. I hope it will work now.

teddybee avatar Sep 20 '22 10:09 teddybee