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'.
average-optician-67817
05/17/2025, 5:05 AM
Of course I have followed the recommendations to fix this problem but the issue is persisting
average-optician-67817
05/17/2025, 5:11 AM
If I change my imports to use relative paths instead the name of my internal package,
pulumi up
works as expected.
l
little-cartoon-10569
05/18/2025, 8:00 PM
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.
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.