#"Error: Background Worker started without tasks." when deploying

1 messages · Page 1 of 1 (latest)

main berry
#

Getting this error when trying to deploy on 3.0.0-beta.49. In dev everything works fine and tasks are recognized.

Error locally:

Trigger.dev (3.0.0-beta.49)
------------------------------------------------------
┌  Deploying project
│
◇  Retrieved your account details for [email protected]
│
◇  Preparing to deploy "acme-dev" (proj_xxx) to prod
│
◇  Typechecking passed with 0 errors
│
◇  Project built successfully
│
◇  Dependencies resolved
│
◇  Deployment encountered an error. View deployment
X Error: Background Worker started without tasks. Searched in: /Users/ldx/Repositories/acme/packages/tasks/trigger

Error from the deployment log on the dashboard:

Error: Background Worker started without tasks. Searched in: /Users/ldx/Repositories/acme/packages/tasks/trigger
    at _a5.initializeWorker_fn (/app/index.js:2099:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.onConnection (/app/index.js:1809:35)
    at async Socket.<anonymous> (/app/node_modules/@trigger.dev/core/dist/v3/zodSocket.js:314:9)

#

My config:

export const config: TriggerConfig = {
  project: "proj_xxx",
  logLevel: "log",
  retries: {
    enabledInDev: true,
    default: {
      maxAttempts: 3,
      minTimeoutInMs: 1000,
      maxTimeoutInMs: 10000,
      factor: 2,
      randomize: true,
    },
  },
  init: async (payload, { ctx }) => {
    if (SENTRY_DSN) {
      Sentry.init({
        dsn: SENTRY_DSN,
        tracesSampleRate: 1,
        environment: acmeEnv.raw,
      });

      Sentry.setTags({
        taskId: ctx.task.id,
      });

      Sentry.setExtras({
        payload,
        taskId: ctx.task.id,
        runId: ctx.run.id,
      });
    }
  },

  triggerDirectories: ["./trigger"],

  additionalFiles: ["../db/prisma/schema.prisma", "../db/zod/prisma/*.ts"],
  additionalPackages: ["prisma@^5.10.2", "zod-prisma-types@^3.1.6"],

  dependenciesToBundle: [/@acme/],

  onFailure: async (payload, error, params) => {
    Sentry.captureException(error);
  },

  instrumentations: [new PrismaInstrumentation()],

  // postInstall: "pnpm run create-schedules",
  postInstall: "npm exec --package prisma -- prisma generate --schema=./db/prisma/schema.prisma",

};
mortal oriole
#

You're exporting tasks from files inside your /trigger folder aren't you? This is weird that it works in dev

main berry
#

yes, why what's wrong with that?

mortal oriole
#

No that's correct

#

I'm calling in backup

near quiver
#

Can you share your project ref?