Skip to content
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 instantiation is excessively deep and possibly infinite" for projection with eight fields #638

Open
judofyr opened this issue Jan 19, 2024 · 1 comment
Labels
help wanted Please help me! I'm lonely.

Comments

@judofyr
Copy link

judofyr commented Jan 19, 2024

import {parse} from '@sanity-typed/groq-js'

parse(`*[_id=="id"]{
  "1": obj.a,
  "2": obj.b,
  "3": obj.c,
  "4": obj.d,
  "5": obj.e,
  "6": obj.f,
  "7": obj.g,
  "8": obj.h,
}`)

Not exactly sure which part is causing the problem, but if I removed the eighth field then it parses correctly.

@saiichihashimoto saiichihashimoto added the help wanted Please help me! I'm lonely. label Jan 19, 2024
@saiichihashimoto
Copy link
Owner

I'm confirming that it fails with 8 projections, but succeeds with 7! Very weird. What's even weirder is that it works if you do a query with 7 projections then 8 projections, like this:

import {parse} from '@sanity-typed/groq-js'

parse(`*[_id=="id"]{
  "1": obj.a,
  "2": obj.b,
  "3": obj.c,
  "4": obj.d,
  "5": obj.e,
  "6": obj.f,
  "7": obj.g,
}`)

parse(`*[_id=="id"]{
  "1": obj.a,
  "2": obj.b,
  "3": obj.c,
  "4": obj.d,
  "5": obj.e,
  "6": obj.f,
  "7": obj.g,
  "8": obj.h,
}`)

Typescript likes to do some strange caching magic sometimes. 🙃

saiichihashimoto added a commit that referenced this issue Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Please help me! I'm lonely.
Projects
None yet
Development

No branches or pull requests

2 participants