Hi. There.
I am trying to get the Temporal worker working in an existing project bundled with webpack. It is a NestJS project living within a pnpm monorepo but not sure whether it matters. The following codes to start the worker failed because:
-
There is no workflows.js in that path during runtime because everything has been bundled into a single main.js
-
The require.resolve() return a number instead of string, which caused an immediate exception during startup.
const workflowsPath = require.resolve(â./temporal/workflowsâ)
const worker = await Worker.create({
workflowsPath,
taskQueue: âdefault-task-queueâ,
activities,
})
I have searched on Google and found this article talking about a similar problem:
And at the end the article concluded that the only way working is to change to use ts-node instead of webpack.
I am wondering whether I really canât have a Temporal worker working with webpack? Is there other workarounds for this problem?
Thanks!