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

ERROR ReferenceError: Buffer is not defined #2

Closed
RamkumarRajendran85 opened this issue Sep 17, 2018 · 9 comments
Closed

ERROR ReferenceError: Buffer is not defined #2

RamkumarRajendran85 opened this issue Sep 17, 2018 · 9 comments

Comments

@RamkumarRajendran85
Copy link

RamkumarRajendran85 commented Sep 17, 2018

When i tried to run this project after npm install. I am getting the below error and not able to load swagger content.

SwaggerComponent_Host.ngfactory.js? [sm]:1 ERROR ReferenceError: Buffer is not defined
at isSpecificValue (deep-extend.js:32)
at deep-extend.js:132
at Array.forEach ()
at deep-extend.js:110
at Array.forEach ()
at push../node_modules/deep-extend/lib/deep-extend.js.module.exports (deep-extend.js:104)
at SwaggerUI (swagger-ui.js:1)
at SwaggerComponent.push../src/app/swagger/swagger.component.ts.SwaggerComponent.ngAfterViewInit (swagger.component.ts:16)
at callProviderLifecycles (core.js:9560)
at callElementProvidersLifecycles (core.js:9534)
View_SwaggerComponent_Host_0 @ SwaggerComponent_Host.ngfactory.js? [sm]:1

Please help.

@drechema
Copy link

Same problem

@hnitzsche
Copy link

npm install buffer

@Vaelor
Copy link

Vaelor commented Oct 30, 2018

npm install buffer

Same issue, installing buffer does not help

@hnitzsche
Copy link

try this for testing:

(window as any).global = window;
// @ts-ignore
window.Buffer = window.Buffer || require('buffer').Buffer;

@Vaelor
Copy link

Vaelor commented Nov 6, 2018

Thanks that works. Sounds a bit fishy though :-D

@drechema
Copy link

Where do you put that code?

@Vaelor
Copy link

Vaelor commented Dec 17, 2018

@drechema polyfills.ts

@agoncal
Copy link
Owner

agoncal commented Mar 5, 2019

Thanks @hnitzsche it works much better now (and I even updated the code to Angular 7)

@agoncal agoncal closed this as completed Mar 5, 2019
MKodde added a commit to OpenConext/Stepup-Webauthn that referenced this issue Nov 30, 2021
Bugfix was inspired by this issue report from a very different source:
agoncal/swagger-ui-angular6#2
MKodde added a commit to OpenConext/Stepup-Webauthn that referenced this issue Jan 10, 2022
Bugfix was inspired by this issue report from a very different source:
agoncal/swagger-ui-angular6#2
MKodde added a commit to OpenConext/Stepup-Webauthn that referenced this issue Jan 10, 2022
Bugfix was inspired by this issue report from a very different source:
agoncal/swagger-ui-angular6#2
MKodde added a commit to OpenConext/Stepup-Webauthn that referenced this issue Jan 10, 2022
Bugfix was inspired by this issue report from a very different source:
agoncal/swagger-ui-angular6#2
@JimLynchCodes
Copy link

tried these suggestions, and now I am getting the error, "Class extends value undefined is not a constructor or null"

MKodde added a commit to OpenConext/Stepup-Webauthn that referenced this issue Feb 10, 2022
Bugfix was inspired by this issue report from a very different source:
agoncal/swagger-ui-angular6#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants