lambda-packages icon indicating copy to clipboard operation
lambda-packages copied to clipboard

Call stack errors when Astro component props are changed repeatedly in MDX files

Open brycewray opened this issue 3 years ago • 11 comments

What version of astro are you using?

1.1.1

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

macOS 12.5.1

Describe the Bug

Repeatedly editing the props supplied to an Astro (.astro) component imported into an MDX file causes a “maximum call stack size exceeded” error, often regarding String.replace. For example:

RangeError: Maximum call stack size exceeded
    at String.replace (<anonymous>)

Although I first thought it was because I was accessing a Twitter API in some erroneous manner, @jasikpark helped me see that, even with the component reduced to only returning results from Math.random() (and, thus, the props are meaningless), the problem persists.

Note that I cannot reproduce the example on Stackblitz, so instead I will link to my own repo with a sample component and file... Test component = https://github.com/brycewray/astro-site/blob/main/src/components/STweet.astro Test MDX file = https://github.com/brycewray/astro-site/blob/main/src/pages/posts/2022/08/tweet-test.mdx

Link to Minimal Reproducible Example

[See above for info]

Participation

  • [ ] I am willing to submit a pull request for this issue.

brycewray avatar Aug 29 '22 13:08 brycewray