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,