jxnblk / mdx-deck

♠️ React MDX-based presentation decks
https://mdx-deck.jxnblk.com
MIT License
11.32k stars 605 forks source link

Infinite loop when using steps #756

Closed wesbos closed 3 years ago

wesbos commented 3 years ago

Steps don't seem to work for me, and I noticed the terminal just runs this across every 1-2 seconds:

success createPages - 0.006s
success Checking for changed pages - 0.002s
success update schema - 0.017s
success onPreExtractQueries - 0.002s
success extract queries from components - 0.015s
success write out requires - 0.002s
info added directory at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/mdx-deck/.cache/redux
info added directory at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/mdx-deck/.cache/redux
info changed file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-
info added directory at
info added directory at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transfo
info added directory at
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-ex
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-ex
info added directory at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transfo
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-ex
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-mo
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-mo
info added directory at
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-mo
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-ex
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-mo
info added directory at
info added directory at
info added directory at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transfo
info added directory at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transfo
info changed file at
info added file at
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-fu
info added directory at
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-fu
info added file at
info added file at
info added directory at
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-mo
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-me
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-me
info added directory at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transfo
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-me
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-na
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-na
info added directory at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transfo
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-na
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-fu
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-mo
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-me
info added file at /Users/wesbos/Dropbox/talks/gatsby-talk/node_modules/@babel/plugin-transform-na
success building schema - 0.250s
info Total nodes: 2218, SitePage nodes: 2 (use --verbose for breakdown)

This is with the following code:

# Hello

---

## This is my deck

---

# Let's try steps

<Steps>
- One
- Two
- Three
- Four
</Steps>
michaelyuen commented 3 years ago

I am seeing something similar as well, having just done a fresh install of v4.1.1.

However, no steps are involved; just the example from getting started.

# Hello

---

## This is my deck

---

## The End

yarn start does build and launch the local server, then the loop begins:

info Total nodes: 166, SitePage nodes: 2 (use --verbose for breakdown)
success createPages - 0.007s
success Checking for changed pages - 0.001s
success update schema - 0.016s
success onPreExtractQueries - 0.002s
success extract queries from components - 0.022s
success write out requires - 0.001s
info added directory at <omitted>/node_modules/mdx-deck/.cache/redux
success building schema - 0.125s
info Total nodes: 166, SitePage nodes: 2 (use --verbose for breakdown)
success createPages - 0.004s
success Checking for changed pages - 0.002s
success update schema - 0.019s
success onPreExtractQueries - 0.001s
success extract queries from components - 0.018s
success write out requires - 0.001s
info added directory at <omitted>/node_modules/mdx-deck/.cache/redux
success building schema - 0.108s
info Total nodes: 166, SitePage nodes: 2 (use --verbose for breakdown)
success createPages - 0.005s
success Checking for changed pages - 0.001s
success update schema - 0.015s
success onPreExtractQueries - 0.003s
success extract queries from components - 0.019s
success write out requires - 0.001s
info added directory at <omitted>/node_modules/mdx-deck/.cache/redux
success building schema - 0.100s
info Total nodes: 166, SitePage nodes: 2 (use --verbose for breakdown)

Additionally

michaelyuen commented 3 years ago

Looks similar to what is reported here: https://github.com/jxnblk/mdx-deck/issues/752

wesbos commented 3 years ago

it does! I tried reverting to 4.0.0 but it persists..

michaelyuen commented 3 years ago

(using 4.0.0) I'm brand new to MDX, but when I change your example from:

# Hello

---

## This is my deck

---

# Let's try steps

<Steps>
- One
- Two
- Three
- Four
</Steps>

to

# Hello

---

## This is my deck

---

# Let's try steps

<Steps>

- One
- Two
- Three
- Four

</Steps>

💰 💰


Note the line breaks added between the jsx and the markdown. Again, new to me but I read it in the README.

wesbos commented 3 years ago

Ohh nice hack of reading the docs :D I will try that! Thank you

wesbos commented 3 years ago

That fixed it, Will close this as there is an issue already for the looping