TypeError: o is not a function

Site Name: https://selftaught-dev.com/ || happy-hugle-97373a
File Causing Issue: https://github.com/ghughes13/Portfolio-v2/blob/master/src/functions/identity-signup.js

The error occurs when, on selftaught-dev.com, you go to “log in” -> “Sign Up” -> and try to make a new account with the input fields. You’ll get an “Error: Failed to handle signup webhook”, which when I check the function logs I’m getting a “TypeError: o is not a function” error (see below logs).

I’m trying to use ‘identity-signup’ to handle sending data to a Fauna DB instance but keep getting an ‘o is not a function’ TypeError. I was following one of Jason’s videos (https://youtu.be/wqQ6kF-psu4 around 1:05:50) trying to get Netlify identity and stripe to work together.

Could the build command in my netlify.toml be an issue?
command = " npm run build && npm i --prefix=functions"
I need to build the site and the functions folder since I need node-fetch in the function and the site deploys with no errors so I assume its working, but I don’t know much about .toml.

8:09:47 AM: 2020-10-20T13:09:47.479Z	0cd3ce82-1431-4d20-8291-be423e0c96aa	ERROR	Invoke Error 	{"errorType":"TypeError","errorMessage":"o is not a function","stack":["TypeError: o is not a function","    at Runtime.t.handler (/var/task/src/identity-signup.js:1:1189)","    at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"]}


It appears to be because I was using:
const fetch = require("node-fetch")

and was resolved when I switched to:
import fetch from "node-fetch"