swagger-api / swagger-api/swagger-ui
new SwaggerUI(...) fails with "s is not a function" error after upgrading to swagger-ui@5.28.0
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:
- 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
Sandbox with swagger-ui v5.28.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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