L5-Swagger: API documentation is not shown (show blank page)
I used fresh Laravel 5.4.28 and fresh L5-Swagger version 5.0.3. I have followed the installation and worked properly (also executed l5-swagger:publish
). But the documentation page is not shown.
Just read issue #73 and followed the instruction there, and my page is still blank (the background is light grey, so I supposed the CSS was loaded correctly).
I inspected and found errors mentioning all asset files asset/swagger-ui.css
, asset/swagger-ui-bundle.js
, and asset/swagger-ui-standalone-preset.js
are not found (HTTP 404).
The console showed error:
documentation:75 Uncaught ReferenceError: SwaggerUIBundle is not defined at window.onload
window.onload @ documentation:75
I visited all asset files URL, all files are found and loaded correctly.
Is there something missing? I check the swagger-ui version is 3.0.19.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 18 (8 by maintainers)
@matriphe Adding try_files to the block in Nginx config worked for me.
@ivanm Wow! Thanks for your help!
It’s confirmed, the problem is in the Nginx config. After removing this block in my Nginx, the docs shown correctly.
I had a similar problem, removing this part from my nginx config solved the issue:
nginx was trying the assets before php does.
None of this helped me. But this helped me:
@crestpointmediaph in
nginx.conf
just inserver
. For example:Unexpected end of input
this error is coming in console with blank page.
@josedsilva Many thanks