You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Crypto.randomBytes is not a function–an uncaught TypeError #365
The error I am receiving: Crypto.randomBytes is not a function
seems to derive from the ./~/es7-reflect-metadata/src/helper/gen-randombytes.ts file
gen-randonbytes.ts file includes:
import * as crypto from "crypto";
import {BufferLike} from "./interfaces";
export function genRandomBytes(size: number): BufferLike {
return crypto.randomBytes(size); //Here is where the error occurs
}
I am running:
es7-reflect-metadata: ^1.5.5,
typescript: 1.7.5,
angular2: 2.0.0-beta.7,
npm: 3.8.0,
node: 5.6.0
Activity
PatrickJS commentedon Mar 1, 2016
can you update es7-reflect-metadata 1.6.0 and typescript to 1.8.2
PatrickJS commentedon Mar 1, 2016
you might have to pull latest changes
sumigoma commentedon Mar 1, 2016
Seeing the same error with latest changes, is es7-reflect-metadata missing a dependency on crypto (^0.0.3)?
https://github.com/gdi2290/es7-reflect-metadata/blob/master/package.json
SimonHawesome commentedon Mar 1, 2016
Updating es7-reflect-metadata to 1.6.0 and
typescript to 1.8.2 and
pulling the latest pollyfills.ts seemed to have fixed the issue!
Thanks for your help and quick reply!
sumigoma commentedon Mar 2, 2016
Can confirm, latest polyfills and webpack config fixes the issue. Please close.
SimonHawesome commentedon Mar 2, 2016
Hooray!
On Tuesday, March 1, 2016, Yuki K notifications@github.com wrote:
Update polyfills.ts
Update package.json