From 0d7808be4285dd3308aafa8a083272e9177b958a Mon Sep 17 00:00:00 2001 From: Rob Cameron Date: Mon, 16 Sep 2024 15:39:36 -0700 Subject: [PATCH] Add note to error message about running `yarn rw dev` or `yarn rw build` before the workers can be started (#11573) Since job config is loaded from `api/dist` you need to build the site (either with the dev server, or an explicit `yarn rw build`) before that directory will exist. This updates the error message you see if `api/src/lib/jobs.js` can't be found to tell you that info. --- packages/jobs/src/errors.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jobs/src/errors.ts b/packages/jobs/src/errors.ts index 1914aa3461f9..9a077a97535d 100644 --- a/packages/jobs/src/errors.ts +++ b/packages/jobs/src/errors.ts @@ -1,4 +1,4 @@ -const JOBS_CONFIG_FILENAME = 'jobs.ts/js' +const JOBS_CONFIG_FILENAME = 'jobs.{ts,js}' /** * Parent class for any RedwoodJob-related error @@ -71,7 +71,7 @@ export class JobExportNotFoundError extends RedwoodJobError { export class JobsLibNotFoundError extends RedwoodJobError { constructor() { super( - `api/src/lib/${JOBS_CONFIG_FILENAME} not found. Run \`yarn rw setup jobs\` to create this file and configure background jobs`, + `api/src/lib/${JOBS_CONFIG_FILENAME} not found. Run \`yarn rw setup jobs\` to create this file and configure background jobs. Already did that? You'll need to run \`yarn rw dev\` or \`yarn rw build\` before you can start the job workers!`, ) } }