aws-sdk:从angular5更新为angular6后崩溃
发布时间:2020-12-17 18:00:15 所属栏目:安全 来源:网络整理
导读:我刚从Angular 5.2更新到Angular 6.0,我的代码现在突破了这个错误: core.js:1601 ERROR Error: Uncaught (in promise): ReferenceError: global is not definedReferenceError: global is not definedat Object../node_modules/buffer/index.js (index.js:4
我刚从Angular 5.2更新到Angular 6.0,我的代码现在突破了这个错误:
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) 有人知道这个问题吗? 解决方法
将以下内容添加到polyfills.ts中
// aws-sdk requires global to exist (window as any).global = window; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |