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 }}
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.
This is apparently causing issues downstream in Angular 6 (newer WebPack?).
Edit: After a bit of digging I see that "crypto" is now a core Node module and that while you do have runtime checking for the current environment (Node or Browser), it hasn't been isolated for downstream bundlers in general.
FWIW in scenarios like this I typically create two "index.ts" files:
index.client.ts (no reference to require("crypto"))
index.server.ts (has reference to require("crypto"))
@blink1073 That PR works 100% for me (and all browser users) - but if there is a genuine need to fallback to the Node crypto library for some reason (the coreutils might be used in other scenarios like unit tests etc.), then my proposed solution might be more acceptable to @sccolbert
random.ts has a "require" for "crypto", but package.json has no reference to that package:
phosphor/packages/coreutils/src/random.ts
Line 42 in 51a6530
phosphor/packages/coreutils/package.json
Line 14 in 39d54e8
Edit: After a bit of digging I see that "crypto" is now a core Node module and that while you do have runtime checking for the current environment (Node or Browser), it hasn't been isolated for downstream bundlers in general.
FWIW in scenarios like this I typically create two "index.ts" files:
require("crypto")
)require("crypto")
)Then update package.json with:
I can issue a PR for the above if you like (but want to make sure you are happy with the proposed solution before I do the work).
The text was updated successfully, but these errors were encountered: