Common Mistakes in NextJs
Putting a utility function under pages folder
You will see this error during build time:
Build optimization failed: found page without a React Component as default export inThe solution is simply to shift the file out of the pages folder