microsoft / PowerBI-visuals-tools

Contains tools for building/packaging Power BI visuals
https://www.powerbi.com
MIT License
337 stars 152 forks source link

[>= 5.4.2] Uncaught ReferenceError: global is not defined #511

Closed dm-p closed 5 months ago

dm-p commented 7 months ago

Hi team,

When I update powerbi-visuals-tools to either 5.4.2 or 5.4.3, I get the following error in my console when I reload the visual:

image

Following the error links to visual-sandbox > webpack:// > node_modules > randombytes > browser.js in the package, with this error on line 16:

image

Downgrading to 5.4.1 clears the issue, so looks like this might be a recent introduction.

AleksSavelev commented 5 months ago

Hi @dm-p,

It's now forbidden to use "global" reference, so I would recommend to get rid of it.

codexguy commented 4 months ago

@dm-p, not sure if you resolved this yourself but in my case, the issue was I had an "import 'intl'" that was both unnecessary and also caused the same problem you noted. I removed that and was able to successfully move tools to 5.5.1.