Next.js 16.1.6 webpack mode crashes with pdfjs-dist due to bundled webpack <5.103.0 bug (Object.defineProperty on non-object)
When using react-pdf (which depends on pdfjs-dist) with Next.js 16.1.6 in webpack mode, the browser throws 'Uncaught TypeError: Object.defineProperty called on non-object'. This is caused by a known webpack bug (webpack/webpack#20095) fixed in webpack 5.103.0. Next.js 16.1.6 bundles webpack 5.98.0, so the bug is not yet fixed in Next.js. A temporary workaround is to alias pdfjs-dist to its CommonJS legacy build in next.config.js.
