feathers
feathers copied to clipboard
Type instantiation is excessively deep and possibly infinite
Steps to reproduce
Github repository: https://github.com/digitalcortex/feathers-dove-typebox-bug
Expected behavior
No Typescript errors, properly merged types.
Actual behavior
Typescript error Type instantiation is excessively deep and possibly infinite.ts(2589)
System configuration
Please check package.json in the repo above.
NodeJS version: v18.11.0
TypeScript version: ^4.9.3
Operating System: Mac OS
Looks like the error is caused by having moneyTransferServices on both userDataSchema and userSchema. I was able to fix the error by changing the following line in userDataSchema
Type.Partial(userSchema),
to
Type.Omit(Type.Partial(userSchema), ["moneyTransferServices"]),