feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
15.07k stars 752 forks source link

Type instantiation is excessively deep and possibly infinite #2985

Open digitalcortex opened 1 year ago

digitalcortex commented 1 year ago

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

howlettt commented 1 year ago

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"]),