We are trying to use temporal inside an Nx monorepo with pnpm but encoutering issues that seem to be node_modules related.
We are using a webpack to package all worker related code with the worker being the entry point. When trying to start the worker, getting the following error:
Module not found: Error: Can't resolve './<omitted>/src/temporal/workflows.ts' in '/<omitted>/src/temporal'
2022-07-06T07:46:20.137Z [ERROR] resolve './<omitted>/src/temporal/workflows.ts' in '/<omitted>/src/temporal'
Field 'browser' doesn't contain a valid alias configuration
Also tried passing in a workflowBundle which allowed the worker to start but when I try to start a new workflow, the error just happens then.
The way that nx creates the project.json configuration is using webpack to package the app code.
We placed the worker in the same project as the web app and so created a similar build configuration.
Are you saying that this is the wrong way to go about it? Do the worker and activities (and workflows?) need to live in a separate location and be bundled differently? I would love to understand more about this.