From 7760ceaa9651c437cfe6b307657ae23531dedcb0 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 5 Sep 2024 09:55:36 +0200 Subject: [PATCH] Read the controllers.json as string rather than Buffer Buffers can implicitly be converted to string (implicitly using `utf8` as encoding) but the type checker does not like this kind of implicit conversion. When passing an encoding to `fs.readFileSync`, it returns a string by performing an explicit conversion using the provided encoding. --- lib/WebpackConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WebpackConfig.js b/lib/WebpackConfig.js index f1bcd244..1d85e00a 100644 --- a/lib/WebpackConfig.js +++ b/lib/WebpackConfig.js @@ -755,7 +755,7 @@ class WebpackConfig { } // Add configured entrypoints - const controllersData = JSON.parse(fs.readFileSync(controllerJsonPath)); + const controllersData = JSON.parse(fs.readFileSync(controllerJsonPath, 'utf8')); const rootDir = path.dirname(path.resolve(controllerJsonPath)); for (let name in controllersData.entrypoints) {