You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Bree Job not able to resolve the dependencies and throwing JS errors which are potentially referring to JS compiled code (not the actual code). May be the alias resolving issue.
Kind-of stuck, any help would be greatly appreciated.
Node.js version: v18.19.0
OS version: MacOS Sanoma 14.0
Description: Inability to resolve the dependencies
Actual behavior
OR If I strip the job to the provided one below, getting this:
Expected behavior
The expected behaviour would be to atleast run the code and throw sensible erros.
Code to reproduce
Structure:
engage-scheduler.ts
import process from 'process'
import * as path from 'path'
import Bree from 'bree'
Bree.extend(require('@breejs/ts-worker'))
const jobs = [
{
name: 'auto-process-new-transactions-through-llm',
cron: '* * * * *',
// interval: '5m',
},
]
const bree = new Bree({
jobs,
defaultExtension: 'ts',
root: path.join(__dirname, 'jobs'),
defaultRootIndex: 'index.ts',
outputWorkerMetadata: true,
})
export default bree
auto-process-new-transactions-through-llm.ts
import { parentPort } from 'worker_threads'
import process from 'process'
import { Transaction } from 'models/Transaction'
import { Company } from 'models/Company'
const jobName = 'auto-process-new-transactions-through-llm'
const maximumNumberOfTransactionsToProcess = 100
async function main(): Promise<void> {
const transactionsToProcessOfTheFirstCompany: Transaction[] = await Transaction.query().limit(
maximumNumberOfTransactionsToProcess
)
const company: Company = await Company.query().findById(1)
return
}
main()
.then(async () => {
// signal to parent that the job is done
if (parentPort) {
parentPort.postMessage(jobName + ' done at ' + new Date().toLocaleString())
}
// eslint-disable-next-line unicorn/no-process-exit
else {
parentPort.postMessage(jobName + ' exiting at ' + new Date().toLocaleString())
process.exit(0)
}
})
.catch((error) => {
console.log(jobName + ' error in main', error)
parentPort.postMessage(jobName + ' error: ' + error.message)
process.exit(0)
})
The Bree Job not able to resolve the dependencies and throwing JS errors which are potentially referring to JS compiled code (not the actual code). May be the alias resolving issue.
Kind-of stuck, any help would be greatly appreciated.
Node.js version: v18.19.0
OS version: MacOS Sanoma 14.0
Description: Inability to resolve the dependencies
Actual behavior
OR If I strip the job to the provided one below, getting this:
Expected behavior
The expected behaviour would be to atleast run the code and throw sensible erros.
Code to reproduce
Structure:
engage-scheduler.ts
auto-process-new-transactions-through-llm.ts
tsconfig.json
package.json
Checklist
The text was updated successfully, but these errors were encountered: