# Generate: \[error\] Cannot read property 'data' of undefined

**URL:** <https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385>\
**Category:** Developing with Prismic\
**Tags:** nuxtjs\
**Created:** [October 22, 2020, 12:50pm UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385 "2020-10-22T12:50:24Z")\
**Posts on this page:** 16\
**Page:** 2

<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:** [April 22, 2021, 4:50am UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/25 "2021-04-22T04:50:04Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [April 23, 2021, 9:17am UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/26 "2021-04-23T09:17:44Z")

</div>



---

<div class="post-metadata">

**Author:** ![maxvdschee](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@maxvdschee](https://community.prismic.io/u/maxvdschee)\
**Post date:** [April 23, 2021, 2:49am UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/28 "2021-04-23T02:49:26Z")

</div>

He Phill,

Switching to the new Nuxt based full static will not generate all pages. If I don't use the apiOptions I will not get the full 87 pages, and it will just generate 49 pages. Overview pages like /cases will not have any links going to the underlaying pages.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [April 23, 2021, 9:19am UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/29 "2021-04-23T09:19:51Z")

</div>

Hey Max,

That's strange because like I was saying the apiOptions doesn't actually generate the routes/pages, that's done by the Nuxt plugin. Do you know which pages in your project aren't being generated?

---

<div class="post-metadata">

**Author:** ![maxvdschee](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@maxvdschee](https://community.prismic.io/u/maxvdschee)\
**Post date:** [April 23, 2021, 1:04pm UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/30 "2021-04-23T13:04:13Z")

</div>

All pages that are missing from the generate:

```auto
/actueel/events/cloud-native-als-onderdeel-van-de-digitale-strategie
/actueel/nieuws/16-september-2020
/actueel/nieuws/25-maart-2021
/actueel/nieuws/billy-2.0-tijd-voor-een-nieuw-mobiel-usability-lab
/actueel/nieuws/danny-at-work
/actueel/nieuws/hanzehogeschool-groningen-kiest-voor-thefactor.e
/actueel/nieuws/hku-wint-award
/actueel/nieuws/hogescholen-website-benchmark-2020
/actueel/nieuws/klantevent-informatief-confronterend-gezellig-hoopvol
/actueel/nieuws/nieuwe-richtlijn-toegankelijkheidwcag-2.1-van-kracht
/actueel/nieuws/nieuwe-samenwerking-augeo-foundation-en-thefactor.e
/actueel/nieuws/nieuwe-samenwerking-thefactore-eroutes
/actueel/nieuws/nieuws-site-sein
/actueel/nieuws/online-open-dag-van-thefactore-een-terugblik
/actueel/nieuws/onze-nieuwe-website-is-live
/actueel/nieuws/rdw-nieuwe-strategisch-partner
/actueel/nieuws/rene-at-work
/actueel/nieuws/samenwerking-universiteit-leiden
/actueel/nieuws/test
/actueel/nieuws/thefactor.e-in-emerce100-muzikale-verrassing-op-kantoore
/actueel/nieuws/thefactor.e-voor-de-zesde-keer-op-rij-in-emerce-100
/actueel/nieuws/vanaf-nu-kun-je-gratis-de-wereld-verbeteren-door-online
/actueel/nieuws/wijzelf-samenwerking-thefactore
/actueel/at-work/max-at-work
/actueel/at-work/rene-at-work_2

/cases/excap
/cases/myler
/cases/olympia
/cases/olympia1
/cases/patienten-in-de-lead-bij-nieuwe-website-umcg
/cases/test-1
/cases/thefactor.e

/max-at-work

/opinies/4-belangrijke-voordelen-van-een-design-system
/opinies/begin-met-informatiebeveiliging-maak-je-security-officer
/opinies/dankzij-gdpr-weer-de-juiste-focus-op-personalisering
/opinies/internationale-data-soap
/opinies/kunstmatige-intelligentie-3-tendensen
/opinies/met-tfe-de-wereld-over
/opinies/strategy-by-design-katalysator-voor-digitale-organisaties

```

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [April 23, 2021, 3:45pm UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/31 "2021-04-23T15:45:33Z")

</div>

OK, I'll try and look at this Monday with @lihbr .

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [April 27, 2021, 2:58pm UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/32 "2021-04-27T14:58:41Z")

</div>

Hey @maxvdschee ,

I discussed this with Lucie and she explained to me what's going on. So because we removed the `apiOptions` for the route resolver the project then falls back on the default nuxt.js route generator, which creates the routes by crawling links.

> **[The generate Property](https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-generate#routes)**
>
> Configure the generation of your universal web application to a static web application.

So because the documents above aren't linked anywhere in your project their routes aren't generated by Nuxt.js.

This was something that was overcome previously by our route resolver as it does a query server-side for all Prismic documents and creates the routes based on this. _The issue here obviously being that this broke for you because of the hyphen in the parent folder._

**So we have 2 options here:**

1. You can wait until sometime next week for the team to fix the hyphen '-' issue in the route resolver so you can use this.
2. You could write a custom function in your nuxt.config which queries all the docs in your Prismic repo and generates your routes based on this: [The generate Property - NuxtJS](https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-generate#function-which-returns-a-promise)

One of these is obviously easier haha

Let me know what you think.

Thanks.

---

<div class="post-metadata">

**Author:** ![maxvdschee](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@maxvdschee](https://community.prismic.io/u/maxvdschee)\
**Post date:** [April 28, 2021, 5:43am UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/33 "2021-04-28T05:43:19Z")

</div>

Hi @Phil,

Thanks for looking into it. Option 1 sounds good to me! It's just a week, so that's not really a big deal; I'm already pleased this can be fixed on such short notice 🙂

---

<div class="post-metadata">

**Author:** ![maxvdschee](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@maxvdschee](https://community.prismic.io/u/maxvdschee)\
**Post date:** [May 20, 2021, 6:58am UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/36 "2021-05-20T06:58:31Z")

</div>

@Phil How is the issue coming along?

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [May 20, 2021, 9:36am UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/37 "2021-05-20T09:36:17Z")

</div>

Hey Max,

The fix has been created and tested, so we're just waiting to get it merged. I'm following up with the team about when this can happen.

In the meantime a user has suggested a workaround here:

> [@Nuxt route resolve](https://community.prismic.io/t/nuxt-route-resolve/5314/8):
>
> If you plan to have the 'about-type' as a UID you can overcome the hyphen issue on 'about-me' by creating a relationship back to the parent 'about-me' document and using a resolver. For example, your uid page 'about type' has a relationship field 'link\_to\_about' that you link to 'about-me' in Prismic. Then you can use the resolver like so: { type: "about-type", path: "/:about/:uid", resolvers: { about: "link\_to\_about" } }

Let me know if this works for you and I'll update you shortly with the plans to merge the fix.

Thanks.

---

<div class="post-metadata">

**Author:** ![maxvdschee](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@maxvdschee](https://community.prismic.io/u/maxvdschee)\
**Post date:** [May 28, 2021, 3:44am UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/38 "2021-05-28T03:44:54Z")

</div>

He Phil,  
If the fix is just a merge away I would rather wait for a solid fix. But if this is going to take a month I will start looking in the workaround.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [May 28, 2021, 11:11am UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/39 "2021-05-28T11:11:21Z")

</div>

Hopefully, it will be merged by the end of next week.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [June 11, 2021, 9:50am UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/40 "2021-06-11T09:50:34Z")

</div>

Hi @maxvdschee,

We've finally got this deployed and I've activated it for your repo. Sorry about the long delay, we're deploying a lot of stuff at the moment. 😅

For anyone experiencing this in the future, you can message the activations team, [as described here](https://community.prismic.io/t/feature-activations-graphql-integration-fields-etc/847), and we'll get this fix turned on for you. 😄

Thanks.

---

<div class="post-metadata">

**Author:** ![maxvdschee](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@maxvdschee](https://community.prismic.io/u/maxvdschee)\
**Post date:** [June 11, 2021, 12:54pm UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/41 "2021-06-11T12:54:10Z")

</div>

Thank you for providing a fix for the issue. I'm can happily confirm this fixed the problem.

Great work, and many thanks for all the effort!

---

<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:** [June 12, 2021, 12:54pm UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/42 "2021-06-12T12:54:29Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

---

<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:42pm UTC](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385/43 "2021-12-09T15:42:10Z")

</div>



[Previous page](https://community.prismic.io/t/generate-error-cannot-read-property-data-of-undefined/2385.md?page=1)
