typed-ember / glint

TypeScript powered tooling for Glimmer templates
https://typed-ember.gitbook.io/glint
MIT License
109 stars 51 forks source link

Type of property ''@each'' circularly references itself in mapped type UnwrapComputedPropertyGetters #639

Closed simonihmig closed 11 months ago

simonihmig commented 11 months ago

We are seeing these kinds of type errors:

Type of property ''@each'' circularly references itself in mapped type 'UnwrapComputedPropertyGetters<[Fn, Fn] & [unknown, unknown]>'

which are thrown in the types-ramda package:

image

where there is this recursion of the InputTypesOfFns generic type.

The interesting part here is that this started only to pop up when adding an import of @glint/environment-ember-template-imports. This might totally be a red herring though...

Unfortunately I was not able to provide a reproduction. The original repo is closed source, and in a minimal repo I tried to put together with Glint set up and @types/ramda (which depends on types-ramda), this was not happening. So not sure what other ingredient needs to come into play to trigger this!? 🤔

I know this is hard to track down this way, but maybe this rings a bell, or someone has some hints how I can debug this any further?

dfreeman commented 11 months ago

UnwrapComputedPropertyGetters/Setters are (as far as I know) only something that exists in @types/ember*. Since neither those nor @each are defined in Glint itself, I feel fairly confident saying that the root of the issue isn't in this repo.

It's totally possible that something odd is going on in the DT types somewhere, though I can't recall ever running into a recursion error like that with those types, and without a reproduction I'm not sure I can offer much more than that ☹️

simonihmig commented 11 months ago

yeah, that makes sense. Thanks for the quick feedback! I'm going to close this for now. Should I find out something that other people might also be interested, I'll post again here...