Skip to content

Commit 7760cea

Browse files
committed
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.
1 parent 2b10db0 commit 7760cea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/WebpackConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ class WebpackConfig {
755755
}
756756

757757
// Add configured entrypoints
758-
const controllersData = JSON.parse(fs.readFileSync(controllerJsonPath));
758+
const controllersData = JSON.parse(fs.readFileSync(controllerJsonPath, 'utf8'));
759759
const rootDir = path.dirname(path.resolve(controllerJsonPath));
760760

761761
for (let name in controllersData.entrypoints) {

0 commit comments

Comments
 (0)