Ive upgraded my app from angular 5 to angular 6. i get the following error now.
Uncaught ReferenceError: global is not defined
at Object../node_modules/auth0-lock/lib/utils/cdn_utils.js (cdn_utils.js:13)
"angular2-jwt": "^0.2.3", "auth0-js": "^9.5.1", "auth0-lock": "^11.6.1",
There was a similar issue in this angular thread:
On version 6 of Angular CLI we are removing the shim for
global
and other node built-ins. You can read more about why this change was made in #9827 (comment).If you are using a library that assumes these globals are present, you can try manually shimming it inside your
polyfills.ts
file:
// Add global to window, assigning the value of window itself. (window as any).global = window;
Adding the line should resolve your error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With