pnpm / pnpm

Fast, disk space efficient package manager
https://pnpm.io
MIT License
29.12k stars 972 forks source link

Issues with Temporal Typescript SDK #4155

Open zkochan opened 2 years ago

zkochan commented 2 years ago

Copied from Discord:

I maintain the Temporal Typescript SDK and users are reporting that they can't use the SDK with pnpm. The SDK uses webpack to bundle user code so it can be run in a node vm. For some reason webpack bundling fails with errors like:

Module not found: Error: Can't resolve '@temporalio/common' in '/Users/bergundy/temporal/samples-typescript/pnpm/node_modules/.pnpm/@temporalio+workflow@0.17.0/node_modules/@temporalio/workflow/lib'

If I look at the filesystem I see that the relevant symlinks exist.

$ ll /Users/bergundy/temporal/samples-typescript/pnpm/node_modules/.pnpm/@temporalio+workflow@0.17.0/node_modules/@temporalio lrwxr-xr-x 66 bergundy 22 Dec 12:26 -I common -> ../../../@temporalio+common@0.17.0/node_modules/@temporalio/common lrwxr-xr-x 64 bergundy 22 Dec 12:26 -I proto -> ../../../@temporalio+proto@0.17.0/node_modules/@temporalio/proto drwxr-xr-x - bergundy 22 Dec 12:26 -I workflow

The webpack configuration can be found here: https://github.com/temporalio/sdk-typescript/blob/66f5bdab66de533aade001bba462df6c83090b63/packages/worker/src/workflow/bundler.ts#L106 There's more going on behind the scenes but even when I try to simplify I'm getting the similar errors. A repro can be found here: https://github.com/flybayer/temporal-pnpm I can try to provide a simpler reproduction if needed.

bergundy commented 2 years ago

Seems like the issue was related to webpack module resolution.

bergundy commented 2 years ago

This issue can be closed