SyntaxFix
Write A Post
Hire A Developer
Questions
I had the same error message. In my case I had inadvertently mixed the ES6 export default function myFunc syntax with const myFunc = require('./myFunc');.
export default function myFunc
const myFunc = require('./myFunc');
Using module.exports = myFunc; instead solved the issue.
module.exports = myFunc;