-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Type collision with generated types #6958
Comments
--- 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
Breaking production builds could be solved by removing/commenting the generate code
|
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. I am happy to open a separate issue. |
Downgrading TS to 5.4 fixed this issue indeed. Thank you @AlessioGr |
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. |
This issue has been automatically locked. |
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
The text was updated successfully, but these errors were encountered: