content icon indicating copy to clipboard operation
content copied to clipboard

Simple content page completely freezes up Firefox/Chrome

Open kbrgmn opened this issue 10 months ago • 2 comments

Environment

Reproduction

GitHub repo here: https://github.com/kbrgmn/nuxt-content-icon-reproduction (as the browser freezes/crashes, stackblitz does not work well here)

Very minimal reproduction:

  • a single page [...slug].vue:
<template>
    <ContentDoc/>
</template>`)
  • 2 components

the first of which is:

<template>
    <Icon name="heroicons:information-circle"/>
</template>

the second component is:

<template>
    <div>
        <p>Different component here</p>
        <div>
            <slot/>
        </div>
    </div>
</template>
  • 1 single simple content markdown page using the two components:
# Issue reproduction

First component (icon):
::ComponentWithIcon
::

::SecondComponent
We have some more content here
- nsetetur sadipscing elitr,
::

Describe the bug

When the page is visited (in dev mode with bun dev), it completely freezes up (both Firefox and Chrome), with no text being selectable, developer console not opening if it hasn't already been opened or opening blank, browser not even closing properly, and this warning is printed hundreds of times repeatedly in the console:

Avoid app logic that relies on enumerating keys on a component instance.
The keys will be empty in production mode to avoid performance overhead.

(the reproduction does not have a single

However, this issue does not occur when a production build is being done with bun run build && node .output/server/index.mjs.

In the reproduction markdown page, there are three (/ 4) distinct components used:

  • the <h1> prose heading (by single '#')
  • the first component shown above (nuxt-icon)
  • the second component shown above
  • a single <li> prose element (by single '-')

When the first component (a nuxt-icon), or the list within the second comopnent (the <li> made with markdown - nsetetur sadipscing elitr,) is removed, the issue does not occur.

Additional context

No response

Logs

No warnings / errors are outputted in the terminal where nuxt dev is run.

kbrgmn avatar Apr 02 '24 22:04 kbrgmn

L422Y from the Nuxt Discord checked that:

  • if the <slot/> from the one component is removed, it doesn't lock up
  • if the <slot/> stays, and - nsetetur sadipscing elitr, is removed, it doesn't lock up

seems like it might be definitely related to nuxt content and the MDC / lexing of children, and using markdown inside of component slots

like it doesn't know what to do with markdown inside the component

kbrgmn avatar Apr 03 '24 00:04 kbrgmn

Are there any news about this? I experience the same and it makes impossible to work. 😕

silvio-e avatar May 14 '24 05:05 silvio-e

Seems to be fixed by now

kbrgmn avatar Jun 26 '24 21:06 kbrgmn