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

totally does not load on production #379

Open
m0x61h0x64i opened this issue Aug 30, 2023 · 1 comment
Open

totally does not load on production #379

m0x61h0x64i opened this issue Aug 30, 2023 · 1 comment
Labels
pinned Issues that will not be automatically closed

Comments

@m0x61h0x64i
Copy link

m0x61h0x64i commented Aug 30, 2023

Hi, yesterday I could load my swagger docs using its URL, but today when i committed my new changes it no longer loads my swagger docs on production, but on the development everything works fine.

my last commit was on Jul 3, at that moment until new commit which was today i dint have problem because yesterday docs loaded fine

after i pushed my new commit today, swagger does not load on production, i can see some errors in the console :

image

swagger-ui-bundle.js:3 Uncaught SyntaxError: Unexpected token '<' (at swagger-ui-bundle.js:3:1)
swagger-ui-standalone-preset.js:3 Uncaught SyntaxError: Unexpected token '<' (at swagger-ui-standalone-preset.js:3:1)
DevTools failed to load source map: Could not load content for https://*/api-docs/swagger-ui.css.map: Unexpected token '<', "
<!-- HTML "... is not valid JSON
swagger-ui-init.js:58 Uncaught ReferenceError: SwaggerUIBundle is not defined
    at window.onload (swagger-ui-init.js:58:7)

I have tried disabling all routes, cause i have written new routes and docs, but that didnt help.

now this is my localhost :
image

and this is my production swagger :
image

swagger-jsdoc version : 6.2.8
swagger-ui-express version : 5.0.0
hosting: vercel

my problem wont be my code, i have checked my Jul 3 commit and it is the same code as it is and also i removed the routes to test if it can be loaded or not but it didnt load swagger doc on production.

EDIT: I have gone to my Jul 3 commit which was the working state of the swagger doc, and it works.

I found the bug, the bug here is that the new version of swagger-ui-express is not compatible with swagger-jsdoc version 6.2.8 but with swagger-ui-express version 4.6.3 and swagger-jsdoc version 6.2.8 it works as expected.

@stale
Copy link

stale bot commented Oct 29, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 29, 2023
@daniloab daniloab added the pinned Issues that will not be automatically closed label Oct 30, 2023
@stale stale bot removed the wontfix label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pinned Issues that will not be automatically closed
Projects
None yet
Development

No branches or pull requests

2 participants