Using Prismic/Nuxt with Netlify

I am trying to get my Prismic project working together with Nuxt and Netlify.
My issue is that when updating content from the Prismic CMS, the localhost gets updated but not the Netlify website.

I have followed Netlifys guide to deployment, which doesn't really help.

My best guess it has something to do with the target inside nuxt-config.js together with the build. But I'm not sure. Or maybe it has something do to with Prismic. Either way, I would appreciate enlightenment.

I am using the latest Nuxt (2.13.2). The target inside nuxt.config.js is set to static. And I build with nuxt build && nuxt export. The whole project is basically set up with the nuxt/prismic tutorial, other than it's using the latest nuxt without the deprecated generate.

One more thing, it shows the updated content with Prismic Preview. But as soon as Preview is off, the content goes away again.

Does anyone here know what the problem might be?

Edit: I tried deploying an entirely clean version of the prismic/nuxt tutorial and I have the same issue where it is not updating the Netlify page.

I think the solution is Webhooks between Netlify and Prismic? Correct me if I’m wrong.

Hi @juliandreas ,

I believe that if you go with a full static deployment, the content can’t be updated (I might be wrong though).

To get around that, you can setup a webhook that triggers a redeploy on Netlify every time you publish content.

EDIT: I guess you had the idea first ^^

2 Likes

I had the solution a couple of seconds ahead of you :smiley:

But yeah, I totally missed this. Havn’t seen it mentioned in any tutorial or doc.

Edit: For future reference, if anyone doesn’t know how to set up a webhook between Netlify and Prismic: https://youtu.be/ZiJ6w_qN_bo?t=395

6 Likes