You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the payload generated-schema within the drizzle, which is placed with other db related files in an internal package(eg: packages/db) of my turborepo. When I tried to build the app, it says:
Linting and checking validity of types .Failed to compile.
../../packages/db/src/schemas/payload.ts:289:16
Type error: Invalid module name in augmentation, module '@payloadcms/db-postgres' cannot be found.
287 | }
288 |
> 289 | declare module '@payloadcms/db-postgres' {
| ^
290 | export interface GeneratedDatabaseSchema {
291 | schema: DatabaseSchema
292 | }
Next.js build worker exited with code: 1 and signal: null
I solved this is manually by adding a line above the generated-schema file: import type {} from "@payloadcms/db-postgres";
This line just simply force TypeScript to load and apply the module augmentation at the bottom of the code without making pulling in any runtime code or cause other issue.
Describe the Bug
I have the payload generated-schema within the drizzle, which is placed with other db related files in an internal package(eg: packages/db) of my turborepo. When I tried to build the app, it says:
I solved this is manually by adding a line above the generated-schema file:
import type {} from "@payloadcms/db-postgres";
This line just simply force TypeScript to load and apply the module augmentation at the bottom of the code without making pulling in any runtime code or cause other issue.
Link to the code that reproduces this issue
https://github.com/anyuj/generate-drizzle-schema-type-error
Reproduction Steps
pnpm dlx create-turbo@latest
npx create-payload-app
Which area(s) are affected? (Select all that apply)
db-postgres
Environment Info
The text was updated successfully, but these errors were encountered: