Skip to content

fix(db-postgres): ensure module augmentation for generated schema is picked up correctly in turborepo #12312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

anyuj
Copy link
Contributor

@anyuj anyuj commented May 3, 2025

What?

Turborepo fails to compile due to type error in the generated drizzle schema.

Why?

TypeScript may not include the module augmentation for @payloadcms/db-postgres, especially in monorepo or isolated module builds. This causes type errors during the compilation process of turborepo project. Adding the type-only import guarantees that TypeScript loads the relevant type definitions and augmentations, resolving these errors.

How?

This PR adds a type-only import statement to ensure TypeScript recognizes the module augmentation for @payloadcms/db-postgres in the generated drizzle schema from payload, and there is no runtime effect.

Fixes #12311

-->
image

@r1tsuu r1tsuu changed the title fix: ensure module augmentation for @payloadcms/db-postgres is picked up correctly in turborepo fix(db-postgres): ensure module augmentation for generated schema is picked up correctly in turborepo May 3, 2025
Copy link
Member

@r1tsuu r1tsuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@anyuj anyuj force-pushed the fix-generated-schema-type-error-for-turborepo branch from 71b8f7e to 788520b Compare May 3, 2025 17:13
@anyuj anyuj requested a review from r1tsuu May 3, 2025 17:16
@DanRibbens DanRibbens merged commit 98283ca into payloadcms:main May 13, 2025
76 checks passed
@anyuj anyuj deleted the fix-generated-schema-type-error-for-turborepo branch May 14, 2025 08:16
kendelljoseph pushed a commit that referenced this pull request May 15, 2025
…picked up correctly in turborepo (#12312)

### What?
Turborepo fails to compile due to type error in the generated drizzle
schema.
### Why?
TypeScript may not include the module augmentation for
@payloadcms/db-postgres, especially in monorepo or isolated module
builds. This causes type errors during the compilation process of
turborepo project. Adding the type-only import guarantees that
TypeScript loads the relevant type definitions and augmentations,
resolving these errors.
### How?
This PR adds a type-only import statement to ensure TypeScript
recognizes the module augmentation for @payloadcms/db-postgres in the
generated drizzle schema from payload, and there is no runtime effect.

Fixes #12311

-->

![image](https://github.com/user-attachments/assets/cdec275c-c062-4eb7-9e6a-c3bc3871dd65)
Copy link
Contributor

🚀 This is included in version v3.38.0

kendelljoseph pushed a commit that referenced this pull request May 19, 2025
…picked up correctly in turborepo (#12312)

### What?
Turborepo fails to compile due to type error in the generated drizzle
schema.
### Why?
TypeScript may not include the module augmentation for
@payloadcms/db-postgres, especially in monorepo or isolated module
builds. This causes type errors during the compilation process of
turborepo project. Adding the type-only import guarantees that
TypeScript loads the relevant type definitions and augmentations,
resolving these errors.
### How?
This PR adds a type-only import statement to ensure TypeScript
recognizes the module augmentation for @payloadcms/db-postgres in the
generated drizzle schema from payload, and there is no runtime effect.

Fixes #12311

-->

![image](https://github.com/user-attachments/assets/cdec275c-c062-4eb7-9e6a-c3bc3871dd65)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turborepo fails to compile due to type error in the generated drizzle schema
3 participants