# Error occurred prerendering when doing yarn build

**URL:** <https://community.prismic.io/t/error-occurred-prerendering-when-doing-yarn-build/5807>\
**Category:** Developing with Prismic\
**Tags:** nextjs\
**Created:** [June 16, 2021, 11:08am UTC](https://community.prismic.io/t/error-occurred-prerendering-when-doing-yarn-build/5807 "2021-06-16T11:08:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fredy](https://avatars.discourse-cdn.com/v4/letter/f/d6d6ee/32.png) [@fredy](https://community.prismic.io/u/fredy)\
**Post date:** [June 16, 2021, 11:08am UTC](https://community.prismic.io/t/error-occurred-prerendering-when-doing-yarn-build/5807/1 "2021-06-16T11:08:50Z")

</div>

we got error when doing a 'yarn next build'

> Error occurred prerendering page "/insights/types/risk". Read more: [Prerender Error | Next.js](https://err.sh/next.js/prerender-error)  
> TypeError: Cannot destructure property 'pageInfo' of '((!fetching) && data && data.items)' as it is undefined.  
> at Search (/path/packages/redacted-website/.next/server/0.760bd3b2e9eb96482b67.js:1531:5)  
> at /path/node\_modules/react-ssr-prepass/dist/react-ssr-prepass.production.min.js:1:3440  
> at rt (/path/node\_modules/react-ssr-prepass/dist/react-ssr-prepass.production.min.js:1:3504)  
> at /path/node\_modules/react-ssr-prepass/dist/react-ssr-prepass.production.min.js:1:7618  
> at /path/node\_modules/react-ssr-prepass/dist/react-ssr-prepass.production.min.js:1:7639  
> at /Users/redacted/Git/Gitlabredacted/redacted/node\_modules/react-ssr-prepass/dist/react-ssr-prepass.production.min.js:1:7093  
> at /Users/redacted/Git/Gitlabredacted/redacted/node\_modules/react-ssr-prepass/dist/react-ssr-prepass.production.min.js:1:8003  
> at processTicksAndRejections (internal/process/task\_queues.js:93:5)  
> at async prepass (/Users/redacted/Git/Gitlabredacted/redacted/packages/redacted-website/.next/server/pages/about.js:4091:3)  
> at async Object.modifyResult (/Users/redacted/Git/Gitlabredacted/redacted/packages/redacted-website/.next/server/pages/about.js:4188:23)

any help would be welcome.  
Thanks

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [June 17, 2021, 2:18am UTC](https://community.prismic.io/t/error-occurred-prerendering-when-doing-yarn-build/5807/2 "2021-06-17T02:18:23Z")

</div>

Hey @fredy, welcome to the Community

Where is (!fetching) && data && data.items coming from?  
Maybe the props of a component aren't correctly passed. Could you show me a screenshot or code snippet of this part o your project.

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [June 24, 2021, 3:17am UTC](https://community.prismic.io/t/error-occurred-prerendering-when-doing-yarn-build/5807/4 "2021-06-24T03:17:20Z")

</div>

closed on June 24, 2021, 3:17am UTC, flag & select 'Something Else' to reopen.

This thread has been closed due to inactivity. [Flag to reopen](https://community.prismic.io/t/re-open-a-thread/2175).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 3:41pm UTC](https://community.prismic.io/t/error-occurred-prerendering-when-doing-yarn-build/5807/5 "2021-12-09T15:41:34Z")

</div>

Opened on December 9, 2021, 3:41pm UTC


