-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
swagger-ui npm module doesn't compile with Angular 7 #4971
Comments
Hey @KutsenkoA, this appears to be an Angular issue - we don't depend on the Before I close it, though... can you provide an angular project repository that I can use to recreate this bug? |
I'm sorry, but you do: Line 80 in 9a9b636
|
Got the same problem here. My error message (as soon as I include swagger-ui):
|
Just chiming in, I got the same error doing the basic installation / setup:
|
Oof - my bad, @KutsenkoA. You're right. I was in the Swagger Client folder when I did So, the root of this issue seems to be that Generally, web application bundlers handle Node builtins: Webpack allows you to polyfill or mock them, for example. This is useful, because it allows us web developers to consume anything on npm without worrying about the environment that the library author was building for. Angular previously shimmed these modules transparently, but the Angular team seems to have decided that they're not doing that going forward (see angular/angular-cli#10681 and angular/angular-cli#9827 (comment)). I attempted to fix this by setting up our Webpack config to mock out I think the only proper way to solve this is to fork I'm going to prioritize this work, since the situation on the Angular side does not seem to be getting better anytime soon, and it's stopping you all dead in your tracks. Hopefully we'll ship a fix this week! |
Okay, I've forked Based on @KutsenkoA's example repository, this appears to be fixed once I link the example project to my local version of Swagger UI, which contains the fix in the PR linked above this comment: ➜ nr build
> imhotep@0.0.0 build /Users/kyle/Code/imhotep
> ng build
u Date: 2018-10-31T22:43:48.288Z
Hash: 26a9399eea22489d90d1
Time: 11434ms
chunk {main} main.js, main.js.map (main) 780 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 228 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.22 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 16.9 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 5.73 MB [initial] [rendered] |
Okay, I'm going to close this out - I'm pretty confident that #4985 fixes this. We'll release a new version of Swagger UI tomorrow with the fix - if you're still having issues, please bump this thread with some details and I'll take another look. Thanks, everyone! |
Q&A (please complete the following information)
Describe the bug you're encountering
Angular application compiles with an error:
To reproduce...
Create a new Angular project then do
npm install swagger-ui
and add code to the app.component.ts:then run
npm start
and you will get an errorExpected behavior
Compile an application without any errors
Additional context or thoughts
I think
xml
dependency requiresstream
lib, which is a part of node.js core and it's not compiled with Angular.The text was updated successfully, but these errors were encountered: