swagger-api / swagger-api/swagger-ui

new SwaggerUI(...) fails with "s is not a function" error after upgrading to swagger-ui@5.28.0

Open
#10,636 4 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q&A (please complete the following information)
  • OS: Ubuntu 22.04
  • Browser: chrome
  • Version: 142.0
  • Method of installation: npm
  • Swagger-UI version: 5.28.0
  • Swagger/OpenAPI version: Swagger 1.0, OpenAPI 2.0
Content & configuration

Here's a sandbox with a minimal reproduction using swagger-ui v5.27.1 which works as expected
https://codesandbox.io/p/devbox/swagger-ui-5-27-1-example-forked-cwkfst?workspaceId=ws_7URHuAnb4he8p4EieYcckW

Describe the bug you're encountering

And this is a copy of the above sandbox that only changes swagger-ui in package.json to v5.28.0
https://codesandbox.io/p/sandbox/eager-bessie-2mvrk4

and now I get an error instead of swagger-ui rendered

TypeError
s is not a function
Object.eval [as render]
/node_modules/swagger-ui/dist/swagger-ui-es-bundle-core.js:2:228223
To reproduce...

Steps to reproduce the behavior:

  1. Just open my reproduction: https://codesandbox.io/p/sandbox/eager-bessie-2mvrk4
Expected behavior

swagger-ui v5.28.0 works the same as v5.27.1

Screenshots

Sandbox with swagger-ui v5.27.1

Image

Sandbox with swagger-ui v5.28.0

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two linked CodeSandbox reproductions, comparing swagger-ui 5.27.1 with 5.28.0, and inspect the reported stack trace in swagger-ui/dist/swagger-ui-es-bundle-core.js. Done means the 5.28.0 sandbox renders Swagger UI without the “s is not a function” error and behaves like 5.27.1.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.