Skip to content

totally does not load on production #379

Open

Description

@m0x61h0x64i

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.

Activity

  1. stale commented on Oct 29, 2023

    @stale

    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.

  2. added
    pinnedIssues that will not be automatically closed
    on Oct 30, 2023
  3. mkonikov commented on Nov 24, 2025

    @mkonikov
    Contributor

    Are you still seeing this issue?

  4. daniloab commented on Nov 25, 2025

    @daniloab
    Collaborator

    I believe this issue is related to the https://github.com/swagger-api/swagger-ui, isn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pinnedIssues that will not be automatically closed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions