Unable to deploy next.js site - Error: .next/prerender-manifest.json: ENOENT: no such file or directory, open '.next/prerender-manifest.json

my website:


no longer deploying from github after changing the domain name now I am getting this error:

Plugin "@netlify/plugin-nextjs" internal error

Error: .next/prerender-manifest.json: ENOENT: no such file or directory, open '.next/prerender-manifest.json'

In "onBuild" event in "@netlify/plugin-nextjs" from Netlify app
at Object.openSync (fs.js:458:3)
at Object.readFileSync (fs.js:360:35)
at readFileSync (/opt/build/repo/.netlify/plugins/node_modules/jsonfile/index.js:50:22)
at getPrerenderManifest (/opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-nextjs/src/lib/helpers/getPrerenderManifest.js:35:20)
at async getPages (/opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-nextjs/src/lib/pages/getStaticProps/pages.js:5:22)
at async setup (/opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-nextjs/src/lib/pages/getStaticProps/setup.js:20:17)
at async setupPages (/opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-nextjs/src/lib/steps/setupPages.js:14:3)
at async build (/opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-nextjs/src/index.js:27:3)
at async nextOnNetlify (/opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-nextjs/src/index.js:75:5)
at async onBuild (/opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-nextjs/index.js:67:5)

Error properties:
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '.next/prerender-manifest.json'

I found this github issue although im not sure if its related:

the advice is that this issue does not happen if running next js version 9.3.0 or greater mine is version “^10.0.5”, I dont know what he means, “pin a version in your yaml file” Ive never had a yaml file. everything was working fine before I changed the domain name. and now on the latest push to github it stopped working. How can I fix it?

1 Like

Hey @abe :wave:

Thanks for reaching out! The best way to get assistance on next.js issues is to file an issue on the repo you linked :slight_smile: from there, our Next.js experts can take a look and assess if this is related or not.

I appreciate you bringing this up!