Home
Support Forums

Deploy failed due to an error in @netlify/plugin-nextjs plugin

Hi,

I have been using netlify to deploy my app. Everything works fine, but now I encounter the issue in deployment.

────────────────────────────────────────────────────────────────
11:12:14 AM:   3. onBuild command from @netlify/plugin-nextjs                
11:12:14 AM: ────────────────────────────────────────────────────────────────
11:12:14 AM: ​
11:12:14 AM: Detected Next.js site. Copying files...
11:12:14 AM: ** Running Next on Netlify package **
11:12:14 AM: 🚀 Next on Netlify 🚀
11:12:14 AM: 🌍️ Copying public/ folder to /opt/build/repo/out
11:12:14 AM: 💼 Copying static NextJS assets to /opt/build/repo/out
11:12:14 AM: ​
11:12:14 AM: ────────────────────────────────────────────────────────────────
11:12:14 AM:   Plugin "@netlify/plugin-nextjs" internal error                
11:12:14 AM: ────────────────────────────────────────────────────────────────
11:12:14 AM: ​
11:12:14 AM:   Error message
11:12:14 AM:   Error: '/opt/build/repo/out/_next/static/HggdaYvhy0TPtQ2vOf0y1/_buildManifest.js' already exists
11:12:14 AM: ​
11:12:14 AM:   Plugin details
11:12:14 AM:   Package:        @netlify/plugin-nextjs
11:12:14 AM:   Version:        3.6.3
11:12:14 AM:   Repository:     git+https://github.com/netlify/netlify-plugin-nextjs.git
11:12:14 AM:   npm link:       https://www.npmjs.com/package/@netlify/plugin-nextjs
11:12:14 AM:   Report issues:  https://github.com/netlify/netlify-plugin-nextjs/issues
11:12:14 AM: ​
11:12:14 AM:   Error location
11:12:14 AM:   In "onBuild" event in "@netlify/plugin-nextjs" from Netlify app
11:12:14 AM:       at mayCopyFile (/opt/build/repo/.netlify/plugins/node_modules/fs-extra/lib/copy-sync/copy-sync.js:62:11)
11:12:14 AM:       at onFile (/opt/build/repo/.netlify/plugins/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:10)
11:12:14 AM:       at getStats (/opt/build/repo/.netlify/plugins/node_modules/fs-extra/lib/copy-sync/copy-sync.js:48:44)
11:12:14 AM:       at startCopy (/opt/build/repo/.netlify/plugins/node_modules/fs-extra/lib/copy-sync/copy-sync.js:38:10)
11:12:14 AM:       at copyDirItem (/opt/build/repo/.netlify/plugins/node_modules/fs-extra/lib/copy-sync/copy-sync.js:122:10)
11:12:14 AM:       at /opt/build/repo/.netlify/plugins/node_modules/fs-extra/lib/copy-sync/copy-sync.js:115:39
11:12:14 AM:       at Array.forEach (<anonymous>)
11:12:14 AM:       at copyDir (/opt/build/repo/.netlify/plugins/node_modules/fs-extra/lib/copy-sync/copy-sync.js:115:23)
11:12:14 AM:       at onDir (/opt/build/repo/.netlify/plugins/node_modules/fs-extra/lib/copy-sync/copy-sync.js:105:10)
11:12:14 AM:       at getStats (/opt/build/repo/.netlify/plugins/node_modules/fs-extra/lib/copy-sync/copy-sync.js:45:37)
11:12:14 AM: ​
11:12:14 AM:   Resolved config
11:12:14 AM:   build:
11:12:14 AM:     command: npm run deploy
11:12:14 AM:     commandOrigin: ui
11:12:14 AM:     publish: /opt/build/repo/out
11:12:14 AM:     publishOrigin: ui
11:12:14 AM:   plugins:
11:12:14 AM:     - inputs: {}
11:12:14 AM:       origin: ui
11:12:14 AM:       package: '@netlify/plugin-nextjs'
1 Like

hi there! sorry to hear this & to be slow to reply!

Could you take a look at the issues here:

and if nothing fits, could you file a new one? thats the best way we can get this in front of the nextjs people at netlify. thanks!

Hi @davidnguyen179 were you able to fix this issue? I’m also getting this with my deployment and i couldn’t find anything related nor useful in the github issues. I’ve tried clearing cache and deploy but it didn’t help.

hi there, if you could’t find anything useful in the issues, please do file a new one! thanks.