If your project allows, adding "type": "module" to my package.json fixed this for me.
"type": "module"