Error on certain pages: "ReferenceError: module is not defined in ES module scope"

Netlify site: https://main--fluffy-melba-d9b41e.netlify.app/
Git repo: GitHub - lc796/disaster-frontend-nextjs: Front-end for disaster web app. Made for dissertation project.

Hi, I am getting an issue when I access the index page or stats page on my site, but the about page is running fine. If it helps, both index and stats page use getStaticProps where about does not.

This is the error I am getting:

ReferenceError: module is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '/var/task/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
    at file:///var/task/___netlify-odb-handler.js:1:1
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async _tryAwaitImport (file:///var/runtime/index.mjs:918:16)
    at async _tryRequire (file:///var/runtime/index.mjs:967:37)
    at async _loadUserApp (file:///var/runtime/index.mjs:991:16)
    at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1032:21)
    at async start (file:///var/runtime/index.mjs:1195:23)
    at async file:///var/runtime/index.mjs:1201:1

Any help would be greatly appreciated! Thanks

Your site is not building for me on Netlify or locally, I get:

Static worker unexpectedly exited with code: null and signal: SIGTERM

> Build error occurred
Error: Collecting page data for [object Object] is still timing out after 2 attempts.

Do you know how I can test this site?