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 #549

Open
viveksahu56722 opened this issue Jun 29, 2023 · 5 comments
Open

SwaggerUIBundle is not defined #549

viveksahu56722 opened this issue Jun 29, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@viveksahu56722
Copy link

I am using flask-restx==1.1.0

My Python is 3.8.10

Sometime I am seeing this issue in my swagger dashboard

GET https://{host}/api/swaggerui/swagger-ui-standalone-preset.js net::ERR_ABORTED 404 (NOT FOUND) {host}/:71 GET https://{host}/api/swaggerui/swagger-ui-bundle.js net::ERR_ABORTED 404 (NOT FOUND) {host}/:7 GET https://{host}/api/swaggerui/swagger-ui.css net::ERR_ABORTED 404 (NOT FOUND) (index):75 Uncaught ReferenceError: SwaggerUIBundle is not defined at window.onload ((index):75:40)

And my dashboard is not getting load because of this issue

Can someone please help me with this ? I am not able to find much about this issue in internet already

@viveksahu56722 viveksahu56722 added the bug Something isn't working label Jun 29, 2023
@peter-doggart
Copy link
Contributor

@viveksahu56722 Did you install flask-restx using pip? It sounds like the swagger components are not installed.

If you clone the project directly from github, you need to have Invoke and npm installed and run inv assets to download the swagger components. We do this as part of the build process when it's published to pypi so they are included in the pip available version.

@viveksahu56722
Copy link
Author

viveksahu56722 commented Jun 29, 2023

@peter-doggart
Yeah I have installed it using pip but this issue is not always there.
Sometimes it is there and automatically gets fixed but again may occur after some time, what could be causing it ?
The above solution for this case too as sometime its working fine ?

@peter-doggart
Copy link
Contributor

It randomly appears whilst the application is running? How is the application deployed?

@viveksahu56722
Copy link
Author

Yes it has been appearing randomly, can it be because of API requests loads in server ? if there are very frequent calls ?
Its deployed on VMware or Physical (Ubuntu 20.04) I think

@mannys247
Copy link
Contributor

mannys247 commented Jul 7, 2023

Hi @viveksahu56722 , I agree @peter-doggart, seems like swagger files are not installed. I would recommand to start fresh with new venv and install all packages. Keep posted how that goes. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants