Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught ReferenceError: global is not defined #2141

Closed
jayeshsheta opened this issue Jul 14, 2018 · 8 comments
Closed

Uncaught ReferenceError: global is not defined #2141

jayeshsheta opened this issue Jul 14, 2018 · 8 comments
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. guidance Question that needs advice or information.

Comments

@jayeshsheta
Copy link

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

@craigbrett17
Copy link

Got this too after resolving #1271.

@craigbrett17
Copy link

craigbrett17 commented Jul 23, 2018

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.

@chrisradek chrisradek added Third Party investigating Issue has been looked at and needs deep dive work by OSDS. and removed Third Party investigating Issue has been looked at and needs deep dive work by OSDS. labels Oct 1, 2018
@srchase srchase added Question closing-soon This issue will automatically close in 4 days unless further comments are made. labels Oct 1, 2018
@srchase
Copy link
Contributor

srchase commented Oct 1, 2018

@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?

@no-response
Copy link

no-response bot commented Oct 8, 2018

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.

@no-response no-response bot closed this as completed Oct 8, 2018
@afaneh262
Copy link

@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

@srchase srchase added guidance Question that needs advice or information. and removed Question labels Jan 4, 2019
@nlndby
Copy link

nlndby commented Jul 24, 2019

worked

@krivoox
Copy link

krivoox commented Aug 27, 2019

yo tenia este error y era porque tenia mal importado el httpClientModule, luego de corregirlo el error desaparecio.

@lock
Copy link

lock bot commented Sep 28, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

7 participants