Common Mistakes in NextJs

Putting a utility function under pages folder

You will see this error during build time:

Error shown during Build:
Build optimization failed: found page without a React Component as default export in

The solution is simply to shift the file out of the pages folder