I just updated to Angular 6.0 from Angular 5.2, my code now break with this error:
core.js:1601 ERROR Error: Uncaught (in promise): ReferenceError: global is
not defined
ReferenceError: global is not defined
at Object../node_modules/buffer/index.js (index.js:43)
at __webpack_require__ (bootstrap:81)
at Object../node_modules/aws-sdk/lib/browserHashUtils.js
(browserHashUtils.js:1)
at __webpack_require__ (bootstrap:81)
at Object../node_modules/aws-sdk/lib/browserHmac.js (browserHmac.js:1)
at __webpack_require__ (bootstrap:81)
at Object../node_modules/aws-sdk/lib/browserCryptoLib.js
(browserCryptoLib.js:1)
at __webpack_require__ (bootstrap:81)
at Object../node_modules/aws-sdk/lib/browser_loader.js (browser_loader.js:4)
at __webpack_require__ (bootstrap:81)
at Object../node_modules/buffer/index.js (index.js:43)
at __webpack_require__ (bootstrap:81)
at Object../node_modules/aws-sdk/lib/browserHashUtils.js
(browserHashUtils.js:1)
at __webpack_require__ (bootstrap:81)
at Object../node_modules/aws-sdk/lib/browserHmac.js (browserHmac.js:1)
at __webpack_require__ (bootstrap:81)
at Object../node_modules/aws-sdk/lib/browserCryptoLib.js
(browserCryptoLib.js:1)
at __webpack_require__ (bootstrap:81)
at Object../node_modules/aws-sdk/lib/browser_loader.js (browser_loader.js:4)
at __webpack_require__ (bootstrap:81)
anybody knows the problem? I have tried ng update but seems like aws-sdk-js doesn’t provide the schematics for updating
Add following to polyfills.ts
// aws-sdk requires global to exist
(window as any).global = window;
There is a workaround until this issue is resolved,
try adding in your index.html head tag the following
<script>
if (global === undefined) {
var global = window;
}
</script>
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