Shapeshift: Type instantiation is excessively deep and possibly infinite
is there any way to do this without getting an eror?
45 Replies
Wait, wasn't this fixed long ago?
I might be on an older version
It was yes
Make sure to update
nope, I'm on latest
according to upgrade-interactive
It was also fixed in TS 5.6 or something like that
Transitive version.
3.9.2
npm
npm doesn't have anything to update transitive dependencies so you'll have to provide
overrides
.
In your package.json
:
Then run npm install
. You can verify the change by checking your package-lock.json
Yarn v1
Yarn v1 (deprecated, recommend updating to v3 (see /tag query:yarnv3
) does not have a way to update transitive dependencies so a similar strategy is required as npm:
In your package.json
:
Then run yarn install
. You can verify the change by checking your yarn.lock
Yarn v3
Yarn v3 can update transitive dependencies so run the command:
pnpm
pnpm can also update transitive dependencies so run the command:
do I need to do that since I have shapeshift as a dependency aalready
@sapphire/shapeshift
Blazing fast input validation and transformation ⚡
❯ Author: sapphiredev
❯ Maintainers: favna, kyranet, and vladfrangu
❯ Latest version: 3.8.1
❯ License: MIT
❯ Date Created: <t:1642365645:d>
❯ Date Modified: <t:1679880304:d>
Dependencies:
fast-deep-equal and lodash
how do I have a higher version
Yarn registry <_<
I think I never changed it
And yarn's Algolia has been having issues
updated the transitive dependency
still the same
Does jetbrains ide use the TS in node_modules
Or built in
I.e. do you also get the issue when running from terminal
not sure but tsc also reports the same issue
this looks wrong
Best make a report to the TS repo then. Anders found and fixed the issue for us last time too. Sec I'll search the issue.
Oh yeah so that's what transitive is for. What does
yarn why @sapphire/shapeshift
give?Hm both the same
What's your TS version?
4.9.5
There's your problem
Update to 5.1.5 or higher
well I hope that doesn't break stuff
TS fixed the bug on their side as well in that version
what was the option to use old decorators
I mean it probably will but that's the life of a developer
The same as before
oh ok then
New decorators are only active if you don't have the options in tsconfig
ts 5.1.6
You're using your global TS, not local
ah right
wait do I even have global ts
Likely
unless volta install it I shouldn't have it
Just always remember to run
yarn tsc
It doesn'tyeah no I don't have global ts
volta list
will show what you have installed that way. For npm it's npm ls -g --depth=0
and for yarn (assuming v1, berry doesn't have globals) yarn global list
webbstorm ide uses local ts
no global ts
errors on both cli and ide
I don't get why this is happening
is there any way to suppress the error and still have the type
Trust me I'll be the first to shout in happiness when ES decorators are properly supported because right now TS still emits tslib code because (last I checked) V8 and by extension Node doesn't even support them yet. The TS API in terms of types is also completely out of wack and doesn't match 1:1 with what the actual spec is supposed to be best I can tell (but the docs are very much lacking)
// @ts-ignore
eh I just want the old ones because nestjs depends on those
But I'd rather you also make an issue similar to https://github.com/microsoft/TypeScript/issues/54491 on their repo. Make sure to include a small repository with a reproduction sample.
GitHub
TS 5.1.3 Regression: TSC Compiler throws FATAL ERROR: Reached heap ...
Bug Report 🔎 Search Terms tsc, compiler, heap limit, crash, memory 🕗 Version & Regression Information This is a crash This changed between versions 5.0.4 and 5.1.3 ⏯ Repository Link https://git...
I'll look into that tomorrow
For now. It's safe to assume that NestJS and all such libraries that rely on decorators will transition eventually. But they don't for the exact same reason as @sapphire/decorators and that reason is as said above, not actually supported yet.
well yeah it's going happen at some point
we are still not at that point tho, thanks ecma for being slow af
this will do for now I guess