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

SwaggerUIBundle is not defined #33

Closed
maikelRA opened this issue Oct 19, 2017 · 10 comments
Closed

SwaggerUIBundle is not defined #33

maikelRA opened this issue Oct 19, 2017 · 10 comments

Comments

@maikelRA
Copy link

When I try to navigate to api/documentation response SwaggerUIBundle is not defined. In the code, SwaggerUIBundle make reference to swagger-ui/dist/swagger-ui-bundle.js, but I don't know why response SwaggerUIBundle is not defined.

@DarkaOnLine
Copy link
Owner

is swagger-ui-bundle.js loaded or not ? Where do you see this error ?

@smuthiya
Copy link

smuthiya commented Apr 5, 2018

I am getting the same error with my Web APIs built using ASPNETCore - 'SwaggerUIBundle' is undefined
I get this error when i navigate to /swagger to see the UI - but noting loads in browser and I get this error in browser console. However my json endpoint is working i.e. /swagger/v1/swagger.json I get json response back with my API details. But Swagger UI does not work

@Corneldj
Copy link

I hope this is not too late to post. But I had the same issue and found a solution to it:

  1. Check if all your controller methods have [http] tag. If they all do and still doesn't work go to step 2
  2. In your configure function ensure that you have app.UseStaticFiles(); If it still doesn't work go to step 3
  3. Uninstall and reinstall swagger. If it doesn't work go to step 4 (Core Only)
  4. If you are using Core Install Microsoft.AspNetCore.StaticFiles and reference it in your project.

That is as far as I got and mine started working

@ludonvl
Copy link

ludonvl commented Jun 18, 2018

I found a solution to this issue. For me, I've needed to copy the /dist directory in "vendor/swagger-api/swagger-ui" inside the /public of my lumen project. I'm not sure about the proper way but it works for me.

Hope this can help someone.

@Praphulagarwal
Copy link

If you are working with loopback and having this error you can install swagger-ui-dist from
https://www.npmjs.com/package/swagger-ui-dist
this link.

It resolved my problem

@G-Shriya
Copy link

I am getting the same error with my Web APIs built using ASPNETCore - 'SwaggerUIBundle' is undefined I get this error when i navigate to /swagger to see the UI - but noting loads in browser and I get this error in browser console. However my json endpoint is working i.e. /swagger/v1/swagger.json I get json response back with my API details. But Swagger UI does not work

Facing the same issue.......Above solutions were of no help

@jayasundeep
Copy link

I am facing this issue while integrating openapi into SpringBoot application. Any leads would be greater help. TIA

@aligillaniBD
Copy link

I am facing the same issue with my flask application. It works perfectly fine on my localhost. When I try to run it on k8s environment which have a reverse proxy. It gives me an error in the console that SwaggerUIBundle is not defined and I am not able to see the documentation due to this error.

@melroyvandenberg
Copy link

Same here.. Exactly like @aligillaniBD explained. What do I need to do!??? What the hack is going on.

@Codestronomer
Copy link

Same here, Has anyone found a fix yet? I have a Nestjs application. The documentation works on localhost. Not, the same case on my GCP compute instance.

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