A little late, but could it be that in your package.json, you set
"type": "module"
That'll make it so that on block run, the code that runs in the generated .tmp folder fails since it tries to run as a module.
Removing that "type" setting should fix it.