ncaught ReferenceError: global is not defined
at Object../node_modules/buffer/index.js (index.js:43)
at __webpack_require__ (bootstrap:76)
at Object../node_modules/aws-sdk/lib/browserHashUtils.js (browserHashUtils.js:1)
at __webpack_require__ (bootstrap:76)
at Object../node_modules/aws-sdk/lib/browserHmac.js (browserHmac.js:1)
at __webpack_require__ (bootstrap:76)
at Object../node_modules/aws-sdk/lib/browserCryptoLib.js (browserCryptoLib.js:1)
at __webpack_require__ (bootstrap:76)
at Object../node_modules/aws-sdk/lib/browser_loader.js (browser_loader.js:4)
at __webpack_require__ (bootstrap:76)
./node_modules/buffer/index.js @ index.js:43
__webpack_require__ @ bootstrap:76
./node_modules/aws-sdk/lib/browserHashUtils.js @ browserHashUtils.js:1
__webpack_require__ @ bootstrap:76
./node_modules/aws-sdk/lib/browserHmac.js @ browserHmac.js:1
__webpack_require__ @ bootstrap:76
./node_modules/aws-sdk/lib/browserCryptoLib.js @ browserCryptoLib.js:1
__webpack_require__ @ bootstrap:76
./node_modules/aws-sdk/lib/browser_loader.js @ browser_loader.js:4
__webpack_require__ @ bootstrap:76
./node_modules/aws-sdk/clients/s3.js @ s3.js:1
__webpack_require__ @ bootstrap:76
./src/app/system-service/upload-file.service.ts @ system-service.service.ts:9
__webpack_require__ @ bootstrap:76
./src/app/components/form-upload/form-upload.component.ts @ main.js:852
__webpack_require__ @ bootstrap:76
./src/app/components/system.module.ts @ system-routing.module.ts:19
__webpack_require__ @ bootstrap:76
./src/app/app.module.ts @ app.component.ts:8
__webpack_require__ @ bootstrap:76
./src/main.ts @ environment.ts:15
__webpack_require__ @ bootstrap:76
0 @ main.ts:12
__webpack_require__ @ bootstrap:76
checkDeferredModules @ bootstrap:43
webpackJsonpCallback @ bootstrap:30
(anonymous) @ main.js:1
Got this too after resolving #1271.
It seems slightly related to the aforementioned bug.
Temporary hack around seems to be (from StackOverflow) to add something like this to your polyfils.ts
// aws-sdk requires global to exist
(window as any).global = window;
https://stackoverflow.com/questions/50264344/aws-sdk-crash-after-updating-from-angular5-to-angular6
Perhaps they changed their polyfills or similar in Angular6 to not include global for you. If indeed you are using Angular 6 as I am.
@jayeshsheta
I apologize we didn't get back to you on this issue.
Are you still encountering this issue? Can you provide additional details if it is still happening for you?
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
@jayeshsheta in my case i had to add:
// aws-sdk requires global to exist
(window as any).global = window;
to /src/polyfills.ts
and
"types": ["node"]
to compilerOptions block in /src/tsconfig.app.json
worked
yo tenia este error y era porque tenia mal importado el httpClientModule, luego de corregirlo el error desaparecio.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Most helpful comment
@jayeshsheta in my case i had to add:
to
/src/polyfills.tsand
"types": ["node"]to compilerOptions block in
/src/tsconfig.app.json