Shapeshift: Type instantiation is excessively deep and possibly infinite

s.object({
filteredWords: s.string
.lengthLessThanOrEqual(32)
.array.lengthLessThanOrEqual(50),
filterURLs: s.boolean,
cleanNicknames: s.boolean,
}).strict;
s.object({
filteredWords: s.string
.lengthLessThanOrEqual(32)
.array.lengthLessThanOrEqual(50),
filterURLs: s.boolean,
cleanNicknames: s.boolean,
}).strict;
is there any way to do this without getting an eror?
No description
45 Replies
kyra
kyra11mo ago
Wait, wasn't this fixed long ago?
RedS
RedS11mo ago
I might be on an older version
Favna
Favna11mo ago
It was yes Make sure to update
RedS
RedS11mo ago
nope, I'm on latest according to upgrade-interactive
Favna
Favna11mo ago
It was also fixed in TS 5.6 or something like that Transitive version.
RedS
RedS11mo ago
3.9.2
Spinel
Spinel11mo ago
npm npm doesn't have anything to update transitive dependencies so you'll have to provide overrides. In your package.json:
{
"overrides": {
"package-name-here": "version"
}
}
{
"overrides": {
"package-name-here": "version"
}
}
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:
{
"resolutions": {
"package-name-here": "version"
}
}
{
"resolutions": {
"package-name-here": "version"
}
}
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:
yarn up -R package-name-here
yarn up -R package-name-here
pnpm pnpm can also update transitive dependencies so run the command:
pnpm --recursive update package-name-here@version
pnpm --recursive update package-name-here@version
RedS
RedS11mo ago
do I need to do that since I have shapeshift as a dependency aalready
Spinel
Spinel11mo ago
@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
RedS
RedS11mo ago
how do I have a higher version
Favna
Favna11mo ago
Yarn registry <_< I think I never changed it And yarn's Algolia has been having issues
RedS
RedS11mo ago
updated the transitive dependency still the same
Favna
Favna11mo ago
Does jetbrains ide use the TS in node_modules Or built in I.e. do you also get the issue when running from terminal
RedS
RedS11mo ago
not sure but tsc also reports the same issue
RedS
RedS11mo ago
No description
RedS
RedS11mo ago
this looks wrong
No description
Favna
Favna11mo ago
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?
RedS
RedS11mo ago
No description
Favna
Favna11mo ago
Hm both the same
kyra
kyra11mo ago
What's your TS version?
RedS
RedS11mo ago
4.9.5
Favna
Favna11mo ago
There's your problem Update to 5.1.5 or higher
RedS
RedS11mo ago
well I hope that doesn't break stuff
Favna
Favna11mo ago
TS fixed the bug on their side as well in that version
RedS
RedS11mo ago
what was the option to use old decorators
Favna
Favna11mo ago
I mean it probably will but that's the life of a developer The same as before
RedS
RedS11mo ago
oh ok then
Favna
Favna11mo ago
New decorators are only active if you don't have the options in tsconfig
RedS
RedS11mo ago
ts 5.1.6
No description
Favna
Favna11mo ago
You're using your global TS, not local
RedS
RedS11mo ago
ah right wait do I even have global ts
kyra
kyra11mo ago
Likely
RedS
RedS11mo ago
unless volta install it I shouldn't have it
Favna
Favna11mo ago
Just always remember to run yarn tsc It doesn't
RedS
RedS11mo ago
No description
RedS
RedS11mo ago
yeah no I don't have global ts
No description
Favna
Favna11mo ago
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
RedS
RedS11mo ago
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
Favna
Favna11mo ago
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
RedS
RedS11mo ago
eh I just want the old ones because nestjs depends on those
Favna
Favna11mo ago
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...
RedS
RedS11mo ago
I'll look into that tomorrow
Favna
Favna11mo ago
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.
RedS
RedS11mo ago
well yeah it's going happen at some point we are still not at that point tho, thanks ecma for being slow af
RedS
RedS11mo ago
this will do for now I guess
No description