Forum Discussion

arjunrajas1231's avatar
New Contributor
4 years ago

error while deployed locally Failed to fetch. Possible Reasons: CORS Network Failure

I tried deploying Swagger locally and i was able to open it in browser with the given below url 

and also used the Yaml code as given below

swagger: '2.0'
description: A Simple IP Address API
title: ipify
version: v1
host: ""
- https
- http
basePath: /
- application/json
- application/json
x-swagger-router-controller: hello_world
- hello_world
operationId: hello
- name: name
type: string
in: query
description: the name
description: "Invalid ID supplied"
description: "Pet not found"
description: "Validation exception"


when testing it in Swagger UI i get the error as given below in the screen shot 

please help to overcome this error

2 Replies

  • Hi arjunrajas1231,


    Can you describe how did you "deployed Swagger locally"? Did you use npm scripts from swagger-ui repository  (`npm run start`) or are you running your own server where built swagger-ui is being served?

    From the information that I currently have I don't think CORS is causing requests failure. I can clearly see that you're doing request from the same IP as the swagger-ui is being served. 

    Could you also open developer console in your browser and inspect how the actual request was made and what was the actual response?