swagger-api / swagger-api/swagger-ui
Javascript syntax error on Edge 44.x
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: Window
Browser: Microsoft Edge
Version: 44.17763.831.0
Swagger-UI version: 3.51.2
Content & configuration
Example Swagger/OpenAPI definition:
<script src="swagger-ui-bundle.js" charset="UTF-8"> </script>
<script src="swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
<script>
window.ui = null;
function loadApplicationList(url, callBackFunction) {
var xhttp;
xhttp=new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
callBackFunction(this);
}
}
xhttp.open("GET", url, true);
xhttp.send();
};
function initSwagger(xhttp){
const ui = SwaggerUIBundle({
urls: JSON.parse(xhttp.responseText),
validatorUrl : false,
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
[})]([url](url))
window.ui = ui;
}
window.onload = [loadApplicationList("apidoc/retrievedoclist",initSwagger);
</script>
Describe the bug you're encountering
javascript syntax error - no variable defined at catch block, It's work normal in Chrome browser.
Incorrect syntax: try{}catch{}
Correct syntax: try{}catch(e){}
Screenshots


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 by reproducing the syntax error in Microsoft Edge 44.17763.831.0 using the provided HTML setup and Swagger UI 3.51.2. Inspect swagger-ui-bundle.js and swagger-ui-standalone-preset.js for the reported catch syntax, then verify the bundled assets load without a syntax error in Edge while preserving Chrome behavior.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100