Skip to content

Commit

Permalink
Add note to error message about running yarn rw dev or `yarn rw bui…
Browse files Browse the repository at this point in the history
…ld` 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.
  • Loading branch information
cannikin authored Sep 16, 2024
1 parent 7173844 commit 0d7808b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/jobs/src/errors.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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!`,
)
}
}
Expand Down

0 comments on commit 0d7808b

Please sign in to comment.