Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Bug in powerbi-client after update to 2.11.0

After updating to the 2.11.0 release of powerbi-client for use in Javascript we are receiving a  "TypeError: Cannot read property 'getRandomValues' of undefined" error when trying to load our component. It looks like when we do the import for the client 

import { factories, service } from 'powerbi-client';

This error pops up immediately. This happens in our unit tests with Jest. I don't see mention of this anywhere, and github has no issues available to view there. Does anyone know how to resolve this problem? 

Status: New
Comments
v-yuta-msft
Community Support

@Anonymous ,

 

I would suggest you create a support ticket here for further analysis.

Support Ticket.gif 

 

Regards,

Jimmy Tao

mcmohorn
New Member

I am having the same issue when running our Jest unit tests.  

 

FAIL src/app/app.test.js
● Test suite failed to run

TypeError: Cannot read property 'getRandomValues' of undefined

3 | import { makeStyles } from '@material-ui/core/styles';
4 |
> 5 | import { PowerBIEmbed } from 'powerbi-client-react';
| ^
6 | import { models } from 'powerbi-client';
7 |

at Function.WindowPostMessageProxy.createRandomString (node_modules/powerbi-client/dist/webpack:/~/window-post-message-proxy/dist/windowPostMessageProxy.js:125:1)
at new WindowPostMessageProxy (node_modules/powerbi-client/dist/webpack:/~/window-post-message-proxy/dist/windowPostMessageProxy.js:77:1)
at exports.wpmpFactory (node_modules/powerbi-client/dist/webpack:/src/factories.ts:24:10)
at new Service (node_modules/powerbi-client/dist/webpack:/src/service.ts:140:17)
at Object.<anonymous> (node_modules/powerbi-client/dist/webpack:/src/powerbi-client.ts:58:15)
at __webpack_require__ (node_modules/powerbi-client/dist/webpack:/webpack/bootstrap e3359f5a2f7f804bc3cd:19:1)
at node_modules/powerbi-client/dist/webpack:/webpack/bootstrap e3359f5a2f7f804bc3cd:39:1
at node_modules/powerbi-client/dist/powerbi.js:54:10
at webpackUniversalModuleDefinition (node_modules/powerbi-client/dist/webpack:/webpack/universalModuleDefinition:3:1)
at Object.<anonymous> (node_modules/powerbi-client/dist/webpack:/webpack/universalModuleDefinition:10:2)
at exports (node_modules/powerbi-client-react/dist/webpack:/powerbi-client-react/webpack/universalModuleDefinition:5:10)
at Object.<anonymous> (node_modules/powerbi-client-react/dist/webpack:/powerbi-client-react/webpack/bootstrap:9:39)
at Object.<anonymous> (src/views/bookOfBusiness/powerBI/index.js:5:1)
etc