kiliman / tailwindui-crawler

tailwindui-crawler downloads the component HTML files locally
MIT License
756 stars 94 forks source link

Abort with "RangeError: Maximum call stack size exceeded" #60

Closed jensolafkoch closed 2 years ago

jensolafkoch commented 2 years ago

When I run the crawler I now get the following error:

⏳  Processing /components/application-ui/data-display/calendars...
⏱   233ms (200) https://tailwindui.com/components/application-ui/data-display/calendars
πŸ”  Found 8 components
πŸ“  Writing html small_with_meetings.html
πŸ“  Writing react small_with_meetings.jsx
πŸ“  Writing vue small_with_meetings.vue
πŸ“  Writing alpine small_with_meetings.html
πŸ“  Writing html month_view.html
πŸ“  Writing react month_view.jsx
πŸ“  Writing vue month_view.vue
πŸ“  Writing alpine month_view.html
πŸ“  Writing html week_view.html
πŸ“  Writing react week_view.jsx
πŸ“  Writing vue week_view.vue
‼️   RangeError: Maximum call stack size exceeded
    at LoadedCheerio.Cheerio (D:\dev\utils\tailwindui-crawler-local\node_modules\cheerio\lib\cheerio.js:24:21)
    at new LoadedCheerio (D:\dev\utils\tailwindui-crawler-local\node_modules\cheerio\lib\load.js:32:46)
    at LoadedCheerio.Cheerio (D:\dev\utils\tailwindui-crawler-local\node_modules\cheerio\lib\cheerio.js:35:26)
    at new LoadedCheerio (D:\dev\utils\tailwindui-crawler-local\node_modules\cheerio\lib\load.js:32:46)
    at LoadedCheerio.Cheerio._make (D:\dev\utils\tailwindui-crawler-local\node_modules\cheerio\lib\cheerio.js:93:23)
    at LoadedCheerio.children (D:\dev\utils\tailwindui-crawler-local\node_modules\cheerio\lib\api\traversing.js:78:25)
    at findFirstElementWithClass (D:\dev\utils\tailwindui-crawler-local\index.js:146:42)
    at findFirstElementWithClass (D:\dev\utils\tailwindui-crawler-local\index.js:146:10)
    at findFirstElementWithClass (D:\dev\utils\tailwindui-crawler-local\index.js:146:10)
    at findFirstElementWithClass (D:\dev\utils\tailwindui-crawler-local\index.js:146:10)

Is there anything I can do here?

kiliman commented 2 years ago

I have it running automatically every day via GitHub actions so I didn't notice this error.

There must be something in this component file that the HTML parser doesn't like. I'll take a look at it. Thanks for the heads up.

VIEWVIEWVIEW commented 2 years ago

Seems to happen due to alpine for the calendar. When I'm only saving react/vue it works fine :)