0

the website it's make with Reactjs, Nextjs and Prismic for manage the data on back end

I try to put the content of my article in the getInitialProps in my file, i recover the parameter for found the good article by the slug of article, in development i have no problem but when i want to deploy the application i have an error

Blog.getInitialProps = async ({ query: { uid }, pathname }) => {
  const page = await Prismic.getApi(process.env.PRISMIC_API_ENDPOINT, {
    accessToken: process.env.PRISMIC_ACCESS_TOKEN
  }).then(function(api) {
    return api.getByUID('blog', uid)
  });
  return {
    page,
    uid,
    pathname
  }
};

Actually, when i launch npm run deploy i have this error :

Unable to encode undefined of type undefined 
    at q (/Applications/MAMP/htdocs/cotenature-com/node_modules/prismic-javascript/dist/prismic-javascript.min.js:1:10587)
    at Object.at (/Applications/MAMP/htdocs/cotenature-com/node_modules/prismic-javascript/dist/prismic-javascript.min.js:1:11859)
    at t.getByUID (/Applications/MAMP/htdocs/cotenature-com/node_modules/prismic-javascript/dist/prismic-javascript.min.js:1:3961)
    at /Applications/MAMP/htdocs/cotenature-com/.next/server/static/rZDgTUBaVKx0J4_TTzYMp/pages/blog/[uid].js:693:26
    at process._tickCallback (internal/process/next_tick.js:68:7)

Thanks,

Kérian Pelat
  • 121
  • 2
  • 12
  • Have you checked the issue open on vuejs repo ? https://github.com/prismicio/vuejs-starter/issues/2 is there any answers solving your problem ? – Philippe Aug 09 '19 at 14:02
  • Nop i have tried, and i have already try to put a patch on package but that not solve the issue – Kérian Pelat Aug 09 '19 at 14:12

0 Answers0