microsoft / powerbi-visuals-webpack-plugin

powerbi-visuals-webpack-plugin
MIT License
33 stars 29 forks source link

The file "filename.pbiviz" isn't a valid custom visual #71

Closed twastvedt closed 1 year ago

twastvedt commented 2 years ago

I recently updated my visual to use 3.0.0 of this package and Webpack 5. Building succeeds, and importing the visual into the browser works, but importing the visual into the desktop shows a dialog with this error: "Invalid custom visual: The file '###.pbiviz' isn't a valid custom visual."

This looks to be very similar to this issue: https://github.com/microsoft/PowerBI-visuals-tools/issues/402 (It was also working in the browser, and same error message in desktop.) However, my project is using Webpack directly (this package), without the "pbiviz new" workflow. Looks like @ashfaqdawood was having the same problem (with powerbi-visuals-webpack-plugin) in that issue.

Not sure what to try next. Do you have an example that uses 3.0.0 of this package and works in desktop Power BI?

lucmax94 commented 2 years ago

Hi @twastvedt, were you able find out what was causing the error or fixed it?

twastvedt commented 2 years ago

@lucmax94 alas no, I never got v3 / webpack 5 working

ashfaqdawood commented 2 years ago

I was not able to solve this either using this package, but the workaround for me particularly was to use the out of the box pbiviz package and then edit the pbiviz webpack.config.js to add the relevant sass/scss loader configuration for which I was using this plugin in the first place. Long story short, if you feel the reason for which you are using this plugin can be resolved by modifying the pbiviz webpack.config.js, try that out.

lucmax94 commented 2 years ago

Thanks for the info, I was already afraid that there was no fix or something similar.

AlanRynne commented 1 year ago

I think this can be closed as it seems to be fixed.

For future reference, I bumped into this today using webpack 5 and the latest powerbi npm versions... except for the powerbi-visuals-webpack-plugin.

I had it pinned on version 3.1.0, and was getting isn't a valid visual. Updating to 4.0.0 "just worked" (following the import change noted in the changelog)

Here's our visual, in case anybody needs a real world working example: https://github.com/specklesystems/speckle-powerbi-visuals