From 532228fd45cc6458dd8bd11062cabbdf0c6f52c8 Mon Sep 17 00:00:00 2001 From: Chanphirom Sok <65760336+chanphiromsok@users.noreply.github.com> Date: Mon, 2 Sep 2024 12:01:35 +0700 Subject: [PATCH] [FIXED] :: uuid not resolve on production - previously uuid installed as dev deps in package.json - migrate from uuid to crypto nodejs modules --- .../src/multer/utils/random-generator.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fastify-file-interceptor/src/multer/utils/random-generator.ts b/fastify-file-interceptor/src/multer/utils/random-generator.ts index b1cb370..4602483 100644 --- a/fastify-file-interceptor/src/multer/utils/random-generator.ts +++ b/fastify-file-interceptor/src/multer/utils/random-generator.ts @@ -1,3 +1,5 @@ -import { v4 as uuid } from "uuid"; +const crypto = require("crypto"); -export const randomStringGenerator = () => uuid(); +export const randomStringGenerator = () => { + return crypto.randomUUID({ disableEntropyCache: true }); +};