Closed bajzarpa closed 2 days ago
--- 2024-06-28 UPDATE ---
This happens on 3.0.0-beta.53 for me.
Getting the same error.
No idea, where this came from. Sadly I did not throughly committed while testing.
For me, even pnpm run dev
broke.
But, I without turbo, it works.
"start": "next dev",
"dev": "next dev --turbo",
Breaking production builds could be solved by removing/commenting the generate code
// declare module 'payload' {
// export interface GeneratedTypes extends Config {}
// }
Are you on TypeScript 5.5 or 5.4? If you are on TypeScript 5.5, can you check if this issue still appears on 5.4? (We do not support TypeScript 5.5 on 2.0)
Oh! sorry, I have missed details (added above).
For me, it is happening on 3.0.0-beta.53. Yes, it happens on TypeScript 5.5. But downgrading, did not solve it.
I am happy to open a separate issue.
Are you on TypeScript 5.5 or 5.4? If you are on TypeScript 5.5, can you check if this issue still appears on 5.4? (We do not support TypeScript 5.5 on 2.0)
Downgrading TS to 5.4 fixed this issue indeed. Thank you @AlessioGr
Oh! sorry, I have missed details (added above).
For me, it is happening on 3.0.0-beta.53. Yes, it happens on TypeScript 5.5. But downgrading, did not solve it.
I am happy to open a separate issue.
Check if ts is really downgraded. If you use ^5.4.5, pnpm will still install/keep 5.5.
Had the same problem, keeping 5.4.5 worked.
Closing, we will support ts 5.5 on 3.0 but 2.0 will be compatible with 5.4.5 only.
Link to reproduction
No response
Describe the Bug
The
payload-types.ts
exports an interface like this:but the
node_modules/payload/dist/index.d.ts
also declares aGeneratedTypes
which collides with theGeneratedTypes
above.Sometimes the ts uses the
payload-types.ts
other times it usesnode_modules/payload/dist/index.d.ts
And this what cause the
TypeWithID & Record<string, unknown>
errors when using local api.To Reproduce
Its random, sometimes one
GeneratedTypes
has been referenced instead of the otherPayload Version
2.22.2
Adapters and Plugins
No response