Home
Support Forums

Build fails even on revert to last successful deploy

I need advice to debug deploy Netlify App

I made some changes and then it started failing. I reverted back to the last successful deploy, and yet the same error is occuring during build. Any ideas would be much appreciated.

I get these error:

10:28:56 AM: (node:1402) [DEP_WEBPACK_CHUNK_HAS_ENTRY_MODULE] DeprecationWarning: Chunk.hasEntryModule: Use new ChunkGraph API
10:28:59 AM: info  - Compiled successfully
10:28:59 AM: info  - Collecting page data...
10:29:05 AM: info  - Generating static pages (0/5)
10:29:05 AM: Unhandled error during request: TypeError: c.props.href.startsWith is not a function
10:29:05 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:100
10:29:05 AM:     at Array.some (<anonymous>)
10:29:05 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:72
10:29:05 AM:     at Array.map (<anonymous>)
10:29:05 AM:     at Object.reduceComponents [as reduceComponentsToState] (/opt/build/repo/.next/serverless/chunks/26.js:13713:113)
10:29:05 AM:     at _class.emitChange (/opt/build/repo/.next/serverless/chunks/26.js:16860:54)
10:29:05 AM:     at new _class (/opt/build/repo/.next/serverless/chunks/26.js:16868:12)
10:29:05 AM:     at d (/opt/build/repo/.next/serverless/chunks/26.js:24636:320)
10:29:05 AM:     at bb (/opt/build/repo/.next/serverless/chunks/26.js:24639:16)
10:29:05 AM:     at a.b.render (/opt/build/repo/.next/serverless/chunks/26.js:24645:43)
10:29:05 AM: Error occurred prerendering page "/500". Read more: https://nextjs.org/docs/messages/prerender-error
10:29:05 AM: TypeError: c.props.href.startsWith is not a function
10:29:05 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:100
10:29:05 AM:     at Array.some (<anonymous>)
10:29:05 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:72
10:29:05 AM:     at Array.map (<anonymous>)
10:29:05 AM:     at Object.reduceComponents [as reduceComponentsToState] (/opt/build/repo/.next/serverless/chunks/26.js:13713:113)
10:29:05 AM:     at _class.emitChange (/opt/build/repo/.next/serverless/chunks/26.js:16860:54)
10:29:05 AM:     at new _class (/opt/build/repo/.next/serverless/chunks/26.js:16868:12)
10:29:05 AM:     at d (/opt/build/repo/.next/serverless/chunks/26.js:24636:320)
10:29:05 AM:     at bb (/opt/build/repo/.next/serverless/chunks/26.js:24639:16)
10:29:05 AM:     at a.b.render (/opt/build/repo/.next/serverless/chunks/26.js:24645:43)
10:29:05 AM: info  - Generating static pages (1/5)
10:29:05 AM: Unhandled error during request: TypeError: c.props.href.startsWith is not a function
10:29:05 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:100
10:29:05 AM:     at Array.some (<anonymous>)
10:29:05 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:72
10:29:05 AM:     at Array.map (<anonymous>)
10:29:05 AM:     at Object.reduceComponents [as reduceComponentsToState] (/opt/build/repo/.next/serverless/chunks/26.js:13713:113)
10:29:05 AM:     at _class.emitChange (/opt/build/repo/.next/serverless/chunks/26.js:16860:54)
10:29:05 AM:     at new _class (/opt/build/repo/.next/serverless/chunks/26.js:16868:12)
10:29:05 AM:     at d (/opt/build/repo/.next/serverless/chunks/26.js:24636:320)
10:29:05 AM:     at bb (/opt/build/repo/.next/serverless/chunks/26.js:24639:16)
10:29:05 AM:     at a.b.render (/opt/build/repo/.next/serverless/chunks/26.js:24645:43)
10:29:05 AM: Error occurred prerendering page "/404". Read more: https://nextjs.org/docs/messages/prerender-error
10:29:05 AM: TypeError: c.props.href.startsWith is not a function
10:29:05 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:100
10:29:05 AM:     at Array.some (<anonymous>)
10:29:05 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:72
10:29:05 AM:     at Array.map (<anonymous>)
10:29:05 AM:     at Object.reduceComponents [as reduceComponentsToState] (/opt/build/repo/.next/serverless/chunks/26.js:13713:113)
10:29:05 AM:     at _class.emitChange (/opt/build/repo/.next/serverless/chunks/26.js:16860:54)
10:29:05 AM:     at new _class (/opt/build/repo/.next/serverless/chunks/26.js:16868:12)
10:29:05 AM:     at d (/opt/build/repo/.next/serverless/chunks/26.js:24636:320)
10:29:05 AM:     at bb (/opt/build/repo/.next/serverless/chunks/26.js:24639:16)
10:29:05 AM:     at a.b.render (/opt/build/repo/.next/serverless/chunks/26.js:24645:43)
10:29:05 AM: info  - Generating static pages (2/5)
10:29:05 AM: Unhandled error during request: TypeError: c.props.href.startsWith is not a function
10:29:05 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:100
10:29:05 AM:     at Array.some (<anonymous>)
10:29:05 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:72
10:29:05 AM:     at Array.map (<anonymous>)
10:29:05 AM:     at Object.reduceComponents [as reduceComponentsToState] (/opt/build/repo/.next/serverless/chunks/26.js:13713:113)
10:29:05 AM:     at _class.emitChange (/opt/build/repo/.next/serverless/chunks/26.js:16860:54)
10:29:05 AM:     at new _class (/opt/build/repo/.next/serverless/chunks/26.js:16868:12)
10:29:05 AM:     at d (/opt/build/repo/.next/serverless/chunks/26.js:24636:320)
10:29:05 AM:     at bb (/opt/build/repo/.next/serverless/chunks/26.js:24639:16)
10:29:05 AM:     at a.b.render (/opt/build/repo/.next/serverless/chunks/26.js:24645:43)
10:29:05 AM: Error occurred prerendering page "/contact". Read more: https://nextjs.org/docs/messages/prerender-error
10:29:05 AM: TypeError: c.props.href.startsWith is not a function
10:29:05 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:100
10:29:05 AM:     at Array.some (<anonymous>)
10:29:05 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:72
10:29:05 AM:     at Array.map (<anonymous>)
10:29:05 AM:     at Object.reduceComponents [as reduceComponentsToState] (/opt/build/repo/.next/serverless/chunks/26.js:13713:113)
10:29:05 AM:     at _class.emitChange (/opt/build/repo/.next/serverless/chunks/26.js:16860:54)
10:29:05 AM:     at new _class (/opt/build/repo/.next/serverless/chunks/26.js:16868:12)
10:29:05 AM:     at d (/opt/build/repo/.next/serverless/chunks/26.js:24636:320)
10:29:05 AM:     at bb (/opt/build/repo/.next/serverless/chunks/26.js:24639:16)
10:29:05 AM:     at a.b.render (/opt/build/repo/.next/serverless/chunks/26.js:24645:43)
10:29:05 AM: info  - Generating static pages (3/5)
10:29:06 AM: Unhandled error during request: TypeError: c.props.href.startsWith is not a function
10:29:06 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:100
10:29:06 AM:     at Array.some (<anonymous>)
10:29:06 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:72
10:29:06 AM:     at Array.map (<anonymous>)
10:29:06 AM:     at Object.reduceComponents [as reduceComponentsToState] (/opt/build/repo/.next/serverless/chunks/26.js:13713:113)
10:29:06 AM:     at _class.emitChange (/opt/build/repo/.next/serverless/chunks/26.js:16860:54)
10:29:06 AM:     at new _class (/opt/build/repo/.next/serverless/chunks/26.js:16868:12)
10:29:06 AM:     at d (/opt/build/repo/.next/serverless/chunks/26.js:24636:320)
10:29:06 AM:     at bb (/opt/build/repo/.next/serverless/chunks/26.js:24639:16)
10:29:06 AM:     at a.b.render (/opt/build/repo/.next/serverless/chunks/26.js:24645:43)
10:29:06 AM: Error occurred prerendering page "/services". Read more: https://nextjs.org/docs/messages/prerender-error
10:29:06 AM: TypeError: c.props.href.startsWith is not a function
10:29:06 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:100
10:29:06 AM:     at Array.some (<anonymous>)
10:29:06 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:72
10:29:06 AM:     at Array.map (<anonymous>)
10:29:06 AM:     at Object.reduceComponents [as reduceComponentsToState] (/opt/build/repo/.next/serverless/chunks/26.js:13713:113)
10:29:06 AM:     at _class.emitChange (/opt/build/repo/.next/serverless/chunks/26.js:16860:54)
10:29:06 AM:     at new _class (/opt/build/repo/.next/serverless/chunks/26.js:16868:12)
10:29:06 AM:     at d (/opt/build/repo/.next/serverless/chunks/26.js:24636:320)
10:29:06 AM:     at bb (/opt/build/repo/.next/serverless/chunks/26.js:24639:16)
10:29:06 AM:     at a.b.render (/opt/build/repo/.next/serverless/chunks/26.js:24645:43)
10:29:06 AM: Unhandled error during request: TypeError: c.props.href.startsWith is not a function
10:29:06 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:100
10:29:06 AM:     at Array.some (<anonymous>)
10:29:06 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:72
10:29:06 AM:     at Array.map (<anonymous>)
10:29:06 AM:     at Object.reduceComponents [as reduceComponentsToState] (/opt/build/repo/.next/serverless/chunks/26.js:13713:113)
10:29:06 AM:     at _class.emitChange (/opt/build/repo/.next/serverless/chunks/26.js:16860:54)
10:29:06 AM:     at new _class (/opt/build/repo/.next/serverless/chunks/26.js:16868:12)
10:29:06 AM:     at d (/opt/build/repo/.next/serverless/chunks/26.js:24636:320)
10:29:06 AM:     at bb (/opt/build/repo/.next/serverless/chunks/26.js:24639:16)
10:29:06 AM:     at a.b.render (/opt/build/repo/.next/serverless/chunks/26.js:24645:43)
10:29:06 AM: Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
10:29:06 AM: TypeError: c.props.href.startsWith is not a function
10:29:06 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:100
10:29:06 AM:     at Array.some (<anonymous>)
10:29:06 AM:     at /opt/build/repo/.next/serverless/chunks/26.js:13718:72
10:29:06 AM:     at Array.map (<anonymous>)
10:29:06 AM:     at Object.reduceComponents [as reduceComponentsToState] (/opt/build/repo/.next/serverless/chunks/26.js:13713:113)
10:29:06 AM:     at _class.emitChange (/opt/build/repo/.next/serverless/chunks/26.js:16860:54)
10:29:06 AM:     at new _class (/opt/build/repo/.next/serverless/chunks/26.js:16868:12)
10:29:06 AM:     at d (/opt/build/repo/.next/serverless/chunks/26.js:24636:320)
10:29:06 AM:     at bb (/opt/build/repo/.next/serverless/chunks/26.js:24639:16)
10:29:06 AM:     at a.b.render (/opt/build/repo/.next/serverless/chunks/26.js:24645:43)
10:29:06 AM: info  - Generating static pages (5/5)
10:29:06 AM: > Build error occurred
10:29:06 AM: Error: Export encountered errors on following paths:
10:29:06 AM: 	/
10:29:06 AM: 	/404
10:29:06 AM: 	/500
10:29:06 AM: 	/contact
10:29:06 AM: 	/services
10:29:06 AM:     at /opt/build/repo/node_modules/next/dist/export/index.js:493:19
10:29:06 AM:     at runMicrotasks (<anonymous>)
10:29:06 AM:     at processTicksAndRejections (internal/process/task_queues.js:97:5)
10:29:06 AM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:74:20)
10:29:06 AM:     at async /opt/build/repo/node_modules/next/dist/build/index.js:962:17
10:29:06 AM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:74:20)
10:29:06 AM:     at async /opt/build/repo/node_modules/next/dist/build/index.js:836:13
10:29:06 AM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:74:20)
10:29:06 AM:     at async Object.build [as default] (/opt/build/repo/node_modules/next/dist/build/index.js:82:25)

Could you try using version 4 (beta) of the plugin: v4 beta release · Discussion #706 · netlify/netlify-plugin-nextjs · GitHub?

@hrishikesh, thanks for the tip, unfortunately, that does not resolve the issue. I still get the error TypeError: c.props.href.startsWith is not a function on every page build when ‘Generating static files’. Any ideas what else this could be?

Solved. Seemed to be an issue with me putting a <link... > for the favicon in my <Head> component. Not sure why that is happening? Any ideas?