Need help understanding this error
[0] ParseError: Alias 'type200' has a shallow resolution cycle: type200->type200
[0] at throwError (file:///workspaces/node_modules/.pnpm/@[email protected]/node_modules/@ark/util/out/errors.js:5:11)
[0] at throwParseError (file:///workspaces/node_modules/.pnpm/@[email protected]/node_modules/@ark/util/out/errors.js:10:43)
[0] at AliasNode._resolve (file:///workspaces/node_modules/.pnpm/@[email protected]/node_modules/@ark/schema/out/roots/alias.js:59:24)
[0] at get resolution (file:///workspaces/node_modules/.pnpm/@[email protected]/node_modules/@ark/schema/out/roots/alias.js:46:29)
[0] at file:///workspaces/node_modules/.pnpm/@[email protected]/node_modules/@ark/schema/out/scope.js:407:59
[0] at Array.forEach (<anonymous>)
[0] at bootstrapAliasReferences (file:///workspaces/node_modules/.pnpm/@[email protected]/node_modules/@ark/schema/out/scope.js:406:10)
[0] at InternalScope.finalize (file:///workspaces/node_modules/.pnpm/@[email protected]/node_modules/@ark/schema/out/scope.js:383:9)
[0] at InternalScope.schema (file:///workspaces/node_modules/.pnpm/@[email protected]/node_modules/@ark/schema/out/scope.js:185:37)
[0] at AliasNode.array (file:///workspaces/node_modules/.pnpm/@[email protected]/node_modules/@ark/schema/out/roots/root.js:163:23)
I'm not sure where this is coming from,. or which definition this is happening on. ANy idea what this might be?
6 Replies
It would be helpful to also provide the code which is causing this. If you can't find it using the stack trace, try setting
Error.stackTraceLimit
to Infinity
before running the code.Ah didnt know i could do that. Here's the full schema:
There are not type errors in the above definition. Not sure if im defining the recursive structures correctly tho
I have attatched the link to the playground here (It's too long)
Think the exact cause is because of this:
Anyone know why this happens? Or is it a bug?
Changing it to:
Resolves this issue. However, it's giving me back:
Error
Looks like there is an issue with
this[]
I created an issue to track it:
https://github.com/arktypeio/arktype/issues/1406nice thanks!