From a0de29b497876eb462271ca5ebbeb3ffe1c1d1c4 Mon Sep 17 00:00:00 2001 From: Ramiro Silveyra d'Avila Date: Wed, 23 Dec 2020 09:57:08 -0300 Subject: [PATCH] fix: serializing big strings (#304) --- src/supportWebpack5.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/supportWebpack5.js b/src/supportWebpack5.js index a2a9f61..311acb1 100644 --- a/src/supportWebpack5.js +++ b/src/supportWebpack5.js @@ -60,17 +60,18 @@ export default function runAsChild( workerSource, options ); + const workerCodeBuffer = Buffer.from(workerCode); return cache.store( cacheIdent, cacheETag, - workerCode, + workerCodeBuffer, (storeCacheError) => { if (storeCacheError) { return callback(storeCacheError); } - return callback(null, workerCode); + return callback(null, workerCodeBuffer); } ); });