Has anyone had trouble using pulumi on a monorepo?...
# typescript
a
Has anyone had trouble using pulumi on a monorepo? (turborepo) I keep getting this error when trying to do a
pulumi up
Copy code
error: Running program '/Users/william/Documents/fanzihq/iac/infrastructure/web/src/index.ts' failed with an unhandled exception:
    TSError: ⨯ Unable to compile TypeScript:
    index.ts(3,74): error TS2307: Cannot find module '@fanzi/common' or its corresponding type declarations.
      There are types at '/Users/william/Documents/fanzihq/iac/node_modules/@fanzi/common/src/constants.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.
Of course I have followed the recommendations to fix this problem but the issue is persisting
If I change my imports to use relative paths instead the name of my internal package,
pulumi up
works as expected.
l
I use Pulumi with a couple of monorepos but they're all implemented via yarn workspaces. No issues there. There's some gotchas around compiling typescript lambdas within typescript projects that are hairy enough that I recommend against it now (though it does work, it's just unnecessarily fiddly). Nothing related to your issue.