Skip to content

BUG: Cannot read properties of undefined (reading 'getTime') #227

Description

@chillbrodev

Describe the bug
When trying to schedule a publish I get the error "Cannot read properties of undefined (reading 'getTime')"

[2026-06-08 18:42:03] info: [strapi-plugin-publisher]: Scheduling cron job for action gkes572m1nht1sashy45rv2k at 2026-06-09T18:45:00.000Z
[2026-06-08 18:42:03] error: Cannot read properties of undefined (reading 'getTime')
[2026-06-08 18:42:03] TypeError: Cannot read properties of undefined (reading 'getTime')
[2026-06-08 18:42:03] at Object.registerJob (/opt/app/node_modules/cloud-cronjob-runner/server/services/scheduler.js:66:23)
[2026-06-08 18:42:03] at strapiCronService.add (/opt/app/node_modules/cloud-cronjob-runner/server/register.js:43:29)
[2026-06-08 18:42:03] at CollectionTypeService.scheduleCronJob (/opt/app/node_modules/strapi-plugin-publisher/dist/server/index.js:486:18)
[2026-06-08 18:42:03] at CollectionTypeService.update (/opt/app/node_modules/strapi-plugin-publisher/dist/server/index.js:535:10)
[2026-06-08 18:42:03] at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
[2026-06-08 18:42:03] at async Object.update (/opt/app/node_modules/@strapi/core/dist/core-api/controller/collection-type.js:65:28)
[2026-06-08 18:42:03] at async returnBodyMiddleware (/opt/app/node_modules/@strapi/core/dist/services/server/compose-endpoint.js:46:20)
[2026-06-08 18:42:03] at async policiesMiddleware (/opt/app/node_modules/@strapi/core/dist/services/server/policy.js:21:9)
[2026-06-08 18:42:03] at async /opt/app/node_modules/@strapi/core/dist/services/server/compose-endpoint.js:27:20
[2026-06-08 18:42:03] at async /opt/app/node_modules/@strapi/core/dist/middlewares/body.js:45:17

When I use the plugin locally it all works fine but when I deploy to the cloud I get this error. My project uses Typescript and runs against Node 22 and Strapi 5.47.1 with version 2.0.9 of the publisher-plugin

To Reproduce
Steps to reproduce the behavior:

  1. Go to Content Manager
  2. Click on or create some content
  3. Try to schedule a time to Publish
  4. See Internal Server error Banner

Expected behavior
It should not throw an error

Screenshots
If applicable, add screenshots to help explain your problem.

System

  • Node.js version: >=18.0.0 <=22.x.x
  • NPM version: >=6.0.0
  • Strapi version: 5.47.1
  • Plugin version: 2.0.9
  • Database: Postgres
  • Operating system: Strapi Cloud

Quick note: You can also upload a screenshot or a copy of your package.json

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions