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
kyra2y ago
Wait, wasn't this fixed long ago?
RedS
RedSOP2y ago
I might be on an older version
Favna
Favna2y ago
It was yes Make sure to update
RedS
RedSOP2y ago
nope, I'm on latest according to upgrade-interactive
Favna
Favna2y ago
It was also fixed in TS 5.6 or something like that Transitive version.
RedS
RedSOP2y ago
3.9.2
Spinel
Spinel2y 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
RedSOP2y ago
do I need to do that since I have shapeshift as a dependency aalready
Spinel
Spinel2y 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
RedSOP2y ago
how do I have a higher version
Favna
Favna2y ago
Yarn registry <_< I think I never changed it And yarn's Algolia has been having issues
RedS
RedSOP2y ago
updated the transitive dependency still the same
Favna
Favna2y 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
RedSOP2y ago
not sure but tsc also reports the same issue
RedS
RedSOP2y ago
No description
RedS
RedSOP2y ago
this looks wrong
No description
Favna
Favna2y 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
RedSOP2y ago
No description
Favna
Favna2y ago
Hm both the same
kyra
kyra2y ago
What's your TS version?
RedS
RedSOP2y ago
4.9.5
Favna
Favna2y ago
There's your problem Update to 5.1.5 or higher
RedS
RedSOP2y ago
well I hope that doesn't break stuff
Favna
Favna2y ago
TS fixed the bug on their side as well in that version
RedS
RedSOP2y ago
what was the option to use old decorators
Favna
Favna2y ago
I mean it probably will but that's the life of a developer The same as before
RedS
RedSOP2y ago
oh ok then
Favna
Favna2y ago
New decorators are only active if you don't have the options in tsconfig
RedS
RedSOP2y ago
ts 5.1.6
No description
Favna
Favna2y ago
You're using your global TS, not local
RedS
RedSOP2y ago
ah right wait do I even have global ts
kyra
kyra2y ago
Likely
RedS
RedSOP2y ago
unless volta install it I shouldn't have it
Favna
Favna2y ago
Just always remember to run yarn tsc It doesn't
RedS
RedSOP2y ago
No description
RedS
RedSOP2y ago
yeah no I don't have global ts
No description
Favna
Favna2y 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
RedSOP2y 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
Favna2y 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
RedSOP2y ago
eh I just want the old ones because nestjs depends on those
Favna
Favna2y 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
RedSOP2y ago
I'll look into that tomorrow
Favna
Favna2y 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
RedSOP2y 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
RedSOP2y ago
this will do for now I guess
No description
Want results from more Discord servers?
Add your server