temporalio / sdk-typescript

Temporal TypeScript SDK
Other
544 stars 109 forks source link

[Bug]Could not resolve "__temporal_custom_payload_converter" #1406

Closed tiagomendonc closed 6 months ago

tiagomendonc commented 7 months ago

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

mjameswh commented 7 months ago

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.

tiagomendonc commented 7 months ago

@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?

nubunto commented 7 months ago

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.

tiagomendonc commented 7 months ago

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

tiagomendonc commented 7 months ago

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, });

mjameswh commented 7 months ago

@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?