I'm trying to import a function into a module.exports object. My code is essentially something like this:
import generateHash from "../generateHash.mjs";
module.exports = {
password: generateHash(password),
};
However, I've been receiving the following error:
ERROR: Cannot use import statement outside a module
I've attempted other workarounds like using the require() syntax but to no avail.
Is there any way that I can get around this issue? Thanks in advance to everyone answering!