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

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

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.

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?

All pages that are missing from the generate:





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

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.

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

One of these is obviously easier haha

Let me know what you think.


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 :slight_smile:

1 Like

@Phil How is the issue coming along?

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:

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


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.

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

1 Like

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. :sweat_smile:

For anyone experiencing this in the future, you can message the activations team, as described here, and we'll get this fix turned on for you. :smile:


1 Like

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!

1 Like

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