Nuxt generate is not generating newly created prismic pages

I have a weird issue where newly created pages in Prismic is not generated in my nuxt project.

When running nuxt generate all pages and posts are generated without any issues, except for the newly created prismic pages.

The weird thing is that when I go to the url of the new page, it's working in both development and production. The only difference is that in production I get a 404 in the console GET 404. How this is possible I have no idea.

This is my package list:

"dependencies": {
"@nuxtjs/axios": "^5.13.1",
"@nuxtjs/prismic": "^1.2.6",
"@prismicio/client": "^4.0.0",
"@prismicio/vue": "^2.0.11",
"cookies": "^0.8.0",
"nuxt": "^2.15.3",
"prismic-dom": "^2.2.5",
"vue2-datepicker": "^3.9.0"

  "devDependencies": {
"@nuxtjs/dotenv": "^1.4.1",
"@nuxtjs/eslint-config": "^6.0.0",
"@nuxtjs/eslint-module": "^3.0.2",
"@nuxtjs/svg": "^0.1.12",
"@nuxtjs/tailwindcss": "^4.0.1",
"@tailwindcss/forms": "^0.2.1",
"babel-eslint": "^10.1.0",
"cross-env": "^7.0.3",
"css-loader": "^5.0.0",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-nuxt": "^2.0.0",
"eslint-plugin-prettier": "^3.3.1",
"node-sass": "^5.0.0",
"nodemon": "^2.0.7",
"postcss": "^8.1.10",
"postcss-import": "^13.0.0",
"postcss-loader": "^4.1.0",
"postcss-url": "^10.1.1",
"sass-loader": "^10.1.1"

Is this something you're aware of? My best guess is that it's an issue with my link-resolver/route resolver.

I have a github repo to be sent in a DM if you would need it too.

Here is the request when going to the new page in production:

This is when going to an already existing page in production (the other contact request is a 301 redirect to contact/):

Hey @juliandreas ,

I'll make an educated guess:

Nuxt generate uses a crawler to generate static pages by following internal links. If your newly-created pages aren't linked internally, they won't be rendered. You'll still be able to access them in development, because your app runs in SPA mode in development.

Sometimes you can find them in production if you navigate to them in SPA mode. But, you'll get a 404 if you try to fetch the page. (The static version of the page does not exist, but you can navigate to it client-side.)

Again, this is a guess, and it's possible I'm mistaken about how Nuxt works.

If I'm correct, there's a generate.routes property in the Nuxt config that will let you specify pages that are missed by the crawler to render static versions of:

Let me know if any of that is helpful. If not, I'm happy to look at other possibilities for debugging :slight_smile:


I thought this was an issue with Prismic, but you're very much correct.
I had an unlinked page and as soon as I linked it, it worked.

Big thanks!

1 Like

Great! I'm happy that works :slight_smile:

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