How to Exclude Binary Dependencies from Workflow Bundle?

I replied in a DM in slack but posting here for posterity:

Seems like your code is using EventEmitter which isn’t supported in the workflow sandbox.

Don’t import events or any other Node dependencies.

This is likely a sign that you’re importing something shared between workflows and activities.
The recommended approach to solve this is to create a shared or common package that will work in both the Node.js environment and the deterministic JS sandbox that workflows run in.

We document this here: Foundations - TypeScript SDK feature guide | Temporal Documentation