From 34d72346a00bd4c532a0167d2148f98971e9452c Mon Sep 17 00:00:00 2001 From: Ilfat Galiev Date: Fri, 20 Jun 2025 11:05:36 -0800 Subject: [PATCH] Suppressing error: error The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined --- package-lock.json | 18 ++++++++-------- src/index.js | 52 +++++++++++++++++++++++++++++------------------ 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb74be5..cdbcd74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -464,9 +464,9 @@ } }, "node_modules/brace-expansion": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", - "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "license": "MIT", "dependencies": { @@ -910,9 +910,9 @@ "dev": true }, "node_modules/fast-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", - "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", + "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==", "funding": [ { "type": "github", @@ -1309,9 +1309,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", "engines": { diff --git a/src/index.js b/src/index.js index fde438a..a31959b 100644 --- a/src/index.js +++ b/src/index.js @@ -423,27 +423,39 @@ class PowerBICustomVisualsWebpackPlugin { ); if (this.options.generateResources) { - operations.push( - this.outputFile( - path.join(resourcePath, "visual.js"), - config.content.js, - ), - this.outputFile( - path.join( - resourcePath, - `${prodConfig.visual.guid}.pbiviz.json`, + if (config.content.js != null) { + operations.push( + this.outputFile( + path.join(resourcePath, "visual.js"), + config.content.js, ), - JSON.stringify(prodConfig), - ), - this.outputFile( - path.join(resourcePath, "visual.prod.js"), - config.content.js, - ), - this.outputFile( - path.join(resourcePath, "visual.prod.css"), - config.content.css, - ), - ); + ); + operations.push( + this.outputFile( + path.join(resourcePath, "visual.prod.js"), + config.content.js, + ), + ); + } + if (prodConfig != null) { + operations.push( + this.outputFile( + path.join( + resourcePath, + `${prodConfig.visual.guid}.pbiviz.json`, + ), + JSON.stringify(prodConfig), + ), + ); + } + if (config.content.css != null) { + operations.push( + this.outputFile( + path.join(resourcePath, "visual.prod.css"), + config.content.css, + ), + ); + } } if (this.options.generatePbiviz) {