Bug Description
In version 4.3.1 of powerbi-visuals-webpack-plugin, there are two significant issues affecting development workflow:
Issue 1: Missing Status File
- Expected:
https://localhost:8080/assets/status should return the status file
- Actual: Returns 404 Not Found
- Impact: Dev visual does not work
Issue 2: Incomplete Asset Generation
The webpack plugin generates fewer files compared to the CLI (pbiviz) tool:
CLI (pbiviz) generates in .tmp/drop/:
pbiviz.json
status
visual.css
visual.css.map
visual.js
visual.js.map
Webpack plugin only generates:
Root Cause Analysis
The issue appears to be in the afterCompilation method. After this line, should be generated the other files (status file mainly)
|
await this.outputFile( |
|
path.join(options.dropPath, "pbiviz.json"), |
|
JSON.stringify(config) |
|
); |
|
} |
Current Workaround
// Added to webpack.config.js plugins array
{
apply: (compiler) => {
compiler.hooks.emit.tapAsync('StatusFilePlugin', (compilation, callback) => {
const visualGuid = pbivizFile.visual.guid;
const devMode = false;
const DEBUG = '_DEBUG';
const status = `${new Date().getTime()}\n${visualGuid}${devMode ? DEBUG : ''}`;
const outputPath = path.join(__dirname, ".tmp", "drop", "status");
fsExtra.outputFile(outputPath, status, { encoding: 'utf8' })
.then(() => {
console.log('Status file created!');
callback();
})
.catch((err) => {
console.error('Error creating status file:', err);
callback(err);
});
});
}
}
Environment
Node.js: v18.20.8
powerbi-visuals-webpack-plugin: 4.3.1
Webpack: 5.99.9
Bug Description
In version 4.3.1 of
powerbi-visuals-webpack-plugin, there are two significant issues affecting development workflow:Issue 1: Missing Status File
https://localhost:8080/assets/statusshould return the status fileIssue 2: Incomplete Asset Generation
The webpack plugin generates fewer files compared to the CLI (
pbiviz) tool:CLI (
pbiviz) generates in.tmp/drop/:pbiviz.jsonstatusvisual.cssvisual.css.mapvisual.jsvisual.js.mapWebpack plugin only generates:
pbiviz.jsonRoot Cause Analysis
The issue appears to be in the
afterCompilationmethod. After this line, should be generated the other files (statusfile mainly)powerbi-visuals-webpack-plugin/src/index.js
Lines 182 to 186 in b8b5fa7
Current Workaround
Environment
Node.js: v18.20.8
powerbi-visuals-webpack-plugin: 4.3.1
Webpack: 5.99.9