-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use with Redux toolkit - "Type instantiation is excessively deep and possibly infinite" #19
Comments
thanks for this! Could you post the A typescript playground would be great - something like this |
I've just released a new version of spectacles (1.0.6) with some type optimizations that should help Also, I noticed that you're using typescript version 4.4.3. Spectacles relies heavily on tail-recursion, which was optimized in typescript v 4.5. If it's possible to upgrade, that might help |
@anthonyjoeseph you might consider adding 4.5 as an optional peer dependency? {
"peerDependencies": {
"typescript": "> 4.5.0",
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
} |
Thanks for the suggestion! As per the yarn docs
They refer to "dependencies", not "devDependencies". Typescript is a "devDependency". Unfortunately, I don't think there is a "peerDevDependencies" I will however add it to the README. I'm actively investigating how spectacles-ts behaves on lower versions of typescript as well |
Actually, looks like the Typescript team has a feature for this (sort of) using typeVersions. Going to make a PR |
@ssirowy Closing if lieu of a repro. If you're able to make one, please feel free to post it and we can re-open the issue Thanks for supporting the library! |
@anthonyjoeseph I work with @ssirowy and was looking into this issue. I attempted to update to the latest typescript version but am running into the same problem. I made a TS playground for you here: |
Hey @chrisfernandes102 ! sorry for the very late reply. Are you still getting this error locally? I'm not seeing it on my desktop machine. It could just be an issue w/ the typescript playground system - sometimes imports get a bit messed up. For example, fp-ts HKT doesn't work in playgrounds |
🐛 Potential Bug report
I recently pulled down
spectacles-ts
into a React/Redux-based application as an alternative to using lodash'sget
for pulling data from a Redux store.Unfortunately, I hit a barrier pretty quickly in receiving a "Type instantiation is excessively deep and possibly infinite" error.
My Redux state type is generated using this approach from the Redux toolkit's documentation.
Without getting into details of our Redux store, the structure is fairly flat, with about 9-10 slices defined generated using the Redux toolkit library.
Here is a screenshot of the error:
I am in general just curious if this error has come up before and If this library is expected to work on more complex objects shown in the examples. Would love to give this library use, but stumbled pretty quickly, and any potential ideas on how I can solve would be greatly appreciated. Thanks!
Your environment
The text was updated successfully, but these errors were encountered: