It's because you use CommonJS in a ES module code, try using this syntax instead.
// Do this: export const myFunction = () => {}