sdk-typescript icon indicating copy to clipboard operation
sdk-typescript copied to clipboard

[Bug]Could not resolve "__temporal_custom_payload_converter"

Open tiagomendonc opened this issue 1 year ago • 5 comments

What are you really trying to do?

I'm trying to add a worker to my application so I can use workflows

Describe the bug

Everytime that I try to build my application, it says that some requirements can not be found.

Minimal Reproduction

image

Environment/Versions

  • OS and processor: M2 Mac
  • Temporal Version: ˆ1.8.6
  • Are you using Docker or Kubernetes or building Temporal from source? No

tiagomendonc avatar Apr 30 '24 21:04 tiagomendonc

It looks like you are trying to bundle the @temporalio/worker and @temporalio/workflow packages. This is not supported.

If you really need to bundle your Temporal Worker’s code, you will need to configure your bundler to keep the following packages as external:

@temporalio/worker
@temporalio/workflow
@temporalio/core-bridge
@temporalio/common
@temporalio/worker
@temporalio/proto

You will also need to pre-bundle your workflow code, e.g. by using bundleWorkflowCode() from your building script. See this sample. The file containing your Workflow Bundle’s code will also need to be marked as external.

mjameswh avatar May 01 '24 17:05 mjameswh

@mjameswh help me with a development issue than, without the worker, I can create and start a workflow execution, but I believe that without a worker, it will not be finished, since that my workflow do not complete, is aways in Running status. Is this right?

tiagomendonc avatar May 02 '24 12:05 tiagomendonc

it will not be finished

Exactly, it won't. The workflow is registered as started in Temporal Server, but if you don't have a worker listening on the task queue with the correct workflow definition, then it won't never advance.

nubunto avatar May 03 '24 17:05 nubunto

Got it. Still, I can't build my app with workers. What exactly should I do?

tiagomendonc avatar May 06 '24 18:05 tiagomendonc

Just to be more clear, I start my workflow client and than start the worker like this: const worker = await Worker.create({ workflowsPath: require.resolve("./workflow"), taskQueue: "default", activities, });

tiagomendonc avatar May 06 '24 18:05 tiagomendonc

@tiagomendonc At this point, I really can't tell anything more that what I said previously. Can you please give more details? Why and how are you bundling the Worker itself?

mjameswh avatar May 07 '24 15:05 mjameswh