Closed jandmc closed 1 year ago
If you use the Next Route Handlers (as your code snippet indicates), then you'll have to use it with Quirrel's Next.js App Router adapter. Try replacing import { CronJob } from "quirrel/next"
with import { CronJob } from "quirrel/next-app"
.
Thanks for that hint! It is now working. Even with pages/api jobs in parallel to approuter/api jobs.
Bug Report
Current Behavior I am migrating to nextjs AppRouter. After I adapted my quirrel jobs (so moving to new directory and exporting ist correctly) Invoking a Job in Nextjs AppRouter (using quirell dev server ui) sometimes works, sometimes not. Depending on the name of the route. In case I found a naming which worked, it doesn't matter which code a put inside the handler function it just works as exepected.
Input Code
File in directory src/app/api/cronjobs/sample/route.ts
Expected behavior/code I would expect that the jobs just work as before using nextjs pages router. Strange is that if I move the payload code of a non working job into the handler of a working one, the code works as expected. Maybe something with caching the routes is broken?!
Environment
Additional context/Screenshots .