question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[3.2.0] Illegal invocation at whatwgRNG

See original GitHub issue

Just installed the newest version 3.2.0 and I get this error in Chrome:

Uncaught TypeError: Illegal invocation
    at whatwgRNG (rng-browser.js:13)
    at v4 (v4.js:13)

Just messed around a bit and it looks like you can not assign the method getRandomValue from crypto or msCrypto to a variable (yeah…ugh, I guess it has to do with browser security).

if you go with

var myCrypto = crypto || msCrypto;

if (typeof myCrypto !== 'undefined') {
  var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
  module.exports = function whatwgRNG() {
    myCrypto.getRandomValues(rnds8);
    return rnds8;
  }
}

it should work.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:15
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
Kenpdffillercommented, Jan 16, 2018

парни, можно как-то по-быстрее это залить?

1reaction
demcommented, Jan 16, 2018

Guys, you broke lib near our release. Happily we catch it before something bad happens. Stick to 3.1.0 now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[3.2.0] Illegal invocation at whatwgRNG · Issue #256 - GitHub
Just installed the newest version 3.2.0 and I get this error in Chrome: Uncaught TypeError: Illegal invocation at whatwgRNG ...
Read more >
ajax - jQuery - Illegal invocation - Stack Overflow
Try to set processData: false in ajax settings like this $.ajax({ url : base_url+'index.php', type: 'POST', dataType: 'json', data: data, cache : false, ......
Read more >
"Illegal invocation" errors in JavaScript - Matias Kinnunen
"Invocation" is the act invoking a function, which is the same as calling a function. Invoke = call. An "illegal invocation" error is...
Read more >
Uncaught TypeError: Illegal invocation - jQuery Forum
Hi, I am getting the above error and can't figure our why? kindly help.. This is my code: var formData = new FormData(); ......
Read more >
Uncaught TypeError: Illegal invocation in Ajax function
I'm trying to send a form to my handler, but I get an error "Uncaught TypeError: Illegal invocation". When I try to send...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found