swagger-api / swagger-api/swagger-ui
Getting TypeError: `s is not a function`after upgrading to v5.11.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
- Browser: Chrome
- Version: 135.0.7049.114
- Method of installation: [e.g. npm, dist assets]
- Swagger-UI version: 5.11.0
- Swagger/OpenAPI version: N/A
Content & configuration
Swagger-UI configuration options:
SwaggerUI({
dom_id: "#swagger-ui",
url: $("base").attr("href") + "api/swagger.yaml",
});
Describe the bug you're encountering
We are trying to upgrade swagger-ui from v4 to v5. It was OK when we upgraded to v5.10.5. But since v5.11.0, there is a type error occurring when we access the page.
It appears the error could be related to React, but our project is a pretty small one which does not use React in any way. We simply use webpack to generate a JS bundle file to be consumed in some html pages.
This is our webpack config.
This is the package.json file.
This is how we use the js bundle file.
To reproduce...
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
The page should be correctly displayed.
Screenshots
With 5.11.0:
With 5.10.5:
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 webpack configuration, package.json, and generated JavaScript bundle described in the report; compare dependency and bundling differences between Swagger UI 5.10.5 and 5.11.0. Reproduce the upgrade in the reported Ubuntu/Chrome setup and trace the s is not a function error. Done means the bundled page displays correctly on 5.11.0 without requiring React.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, webpack
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100