-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
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/statusshould 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.jsonstatusvisual.cssvisual.css.mapvisual.jsvisual.js.map
Webpack plugin only generates:
pbiviz.json
Root Cause Analysis
The issue appears to be in the afterCompilation method. After this line, should be generated the other files (status file mainly)
powerbi-visuals-webpack-plugin/src/index.js
Lines 182 to 186 in b8b5fa7
| 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels