79758808

Date: 2025-09-08 11:09:57
Score: 1
Natty:
Report link

The error happens because now UUID (onwards 12+) is ESM-only and no longer supports require().

My recommendation (since you’re on Node.js 20 and starting fresh):
Switch your project to ESM ("type": "module" in package.json) and use:

import { v4 as uuidv4 } from 'uuid';

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Abhishek Mishra