Issue 1:
Bug report

What is the current behavior?

App builds ok on local, but not on vercel

If the current behavior is a bug, please provide the steps to reproduce.

github.com/longfellowone/cloud-client

10:20:45.168	Cloning github.com/longfellowone/cloud-client (Branch: main, Commit: 6266e9f)
10:20:45.644	Cloning completed: 476.471ms
10:20:45.671	Analyzing source code...
10:20:46.967	Installing build runtime...
10:20:49.839	Build runtime installed: 2.871s
10:20:52.765	Looking up build cache...
10:20:54.868	Build cache downloaded [40.73 MB]: 1792.809ms
10:20:56.040	Installing dependencies...
10:20:56.043	Detected `package-lock.json` generated by npm 7...
10:20:57.494	added 2 packages in 1s
10:20:57.496	95 packages are looking for funding
10:20:57.496	run `npm fund` for details
10:20:57.504	Detected Next.js version: 11.1.2
10:20:57.508	Running "npm run build"
10:20:57.786	> build
10:20:57.786	> next build
10:20:58.365	info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
10:20:58.518	info - Checking validity of types...
10:21:02.373	info - Creating an optimized production build...
10:21:04.756	/vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:59190
10:21:04.756	processContextHashSnapshot(path, tsh.hash);
10:21:04.756	^
10:21:04.756	TypeError: Cannot read property 'hash' of null
10:21:04.756	at callback (/vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:59190:46)
10:21:04.756	at /vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:57683:39
10:21:04.757	at /vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:135587:5
10:21:04.757	at Hook.eval [as callAsync] (eval at create (/vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:33832:10), <anonymous>:6:1)
10:21:04.757	at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:33634:14)
10:21:04.757	at AsyncQueue._handleResult (/vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:135557:21)
10:21:04.757	at /vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:135540:11
10:21:04.757	at /vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:59794:14
10:21:04.757	at /vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:59452:6
10:21:04.757	at done (/vercel/path0/node_modules/next/dist/compiled/neo-async/async.js:1:10308)
10:21:04.757	at continueWithHash (/vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:59341:13)
10:21:04.758	at FileSystemInfo._getFileTimestampAndHash (/vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:59363:4)
10:21:04.758	at fromFile (/vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:59730:13)
10:21:04.758	at /vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:59441:15
10:21:04.758	at Array.<anonymous> (/vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:140338:5)
10:21:04.758	at runCallbacks (/vercel/path0/node_modules/next/dist/compiled/webpack/bundle5.js:20480:15)
10:21:04.784	Error: Command "npm run build" exited with 1

What is the expected behavior?

Other relevant information:

webpack version:

Node.js version:

Operating System:

Additional tools:

Issue 2:
Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Running npx next build

Causes the following error:

info - Creating an optimized production build . project-path\node_modules\next\dist\compiled\webpack\bundle5.js:59190 processContextHashSnapshot(path, tsh.hash);

^

TypeError: Cannot read property 'hash' of null

If the current behavior is a bug, please provide the steps to reproduce.

All I assumingly did was adding a layout and components, e.g. footer

What is the expected behavior?

Building instead of failing, or failing gracefully

Other relevant information:

webpack version: 5.58.1 (that came with the next version)

next: 11.1.2

Solution:

I deleted .next to fix this. I'd run vercel --force to skip the build cache if I was on vercel.

If a webpack dev wants to, they can get access to the private repo, and see the differences between the commits in detail.