nitro icon indicating copy to clipboard operation
nitro copied to clipboard

test: add SelfReferentialStruct test case

Open puckey opened this issue 4 weeks ago • 1 comments

Adds a struct with a callback that references the same struct type.

Currently fails with "Maximum call stack size exceeded" due to infinite recursion in nitrogen's type walker.

puckey avatar Dec 01 '25 15:12 puckey

Someone is attempting to deploy a commit to the Margelo Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Dec 01 '25 15:12 vercel[bot]

We need to add https://nitro.margelo.com/docs/types/custom-structs#cyclic-references-are-not-supported

mrousavy avatar Dec 02 '25 09:12 mrousavy

For this case I expected it to be possible, or is it something you don't want to support:

export interface SelfReferentialStruct {
  transform?: (config: SelfReferentialStruct) => Promise<SelfReferentialStruct>
}

puckey avatar Dec 02 '25 10:12 puckey

Closing in favor of #1074 which includes this test case along with a fix

puckey avatar Dec 02 '25 13:12 puckey