prismic: If Prismic endpoint is not available then complete website is down

As per the documents I am injecting Prismic in the modules section of the nuxt.config.js.

modules: ['@nuxtjs/prismic' ],
prismic: {
    endpoint: 'https://your-repo-name.cdn.prismic.io/api/v2',
    linkResolver: '@/plugins/link-resolver',
    htmlSerializer: '@/plugins/html-serializer'
}

I am integrating prismic content as blog in my existing nuxt website at /blogs, I realized that if in case Prismic URL is not available (if Prismic server is down or URL is incorrect) then the complete website doesn’t load at all (all routes are blocked).

Can you please suggest any workaround for this ?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15

Most upvoted comments

@lihbr @hypervillain we’ve had our website go down twice this week even though I can see in our logs it says “Preventing fatal error”. So seems like it’s not actually preventing the error.

We’re investigating our Prismic content to see if there’s something broken on that side but thought I would comment on this issue as well.

@jainsuneet is this working fine for you after this fix?

There is still no proper solution, because of that we decided to move to another cms solution (Strapi). We cannot allow one module to break the whole website.

This is a worst case scenario but as @lihbr mentioned that they had an outage and any sort of outage on Prismic is directly impacting the website using it completely, even you are using Prismic only on your certain pages of website.

Ok I’ll leave open and see what I can do

You’re welcome! Config looks good to me, I guess you’re using Nuxt SSR with Node right? (according to your modules) Not sure of what could cause it so far as long as your CONTENT_URL environment variable is filled correctly.

Happy to dig more into it if you figure out how to reproduce a fatal with a trycatch statement ☺️