Error [ERR_REQUIRE_ESM] with Node.js 13
I created new project using ESM, since Node 13.2+ supports it without any flags. Instead of using .mjs extension I added "type: module" to package.json. With this setup "tap" throws an error, when I try to run "tap test/test.js":
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module
require() of ES modules is not supported.
require() of /index.js from /test/test.js
even though I only use imports everywhere and in test.js import of index.js looks like this:
import {fastify} from '../index.js';
If I delete "type: module" & change extensions to ".mjs" everything works just fine.
Is it Node.js or "tap" issue?
Node version: 13.10.1 npm: 6.13.7 tap: 14.10.6