Burhan Shakir
01/12/2025, 5:14 PMAccess to fetch at 'https://{cloud_functuion_url}/' from origin '<http://localhost:8080>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Could someone advice on how to fix this ? Do I need to enable CORS on the firebase side (sorry I dont have much experience with this) ?
This is how I initialise the ktor client in DI:
val networkModule = module {
single {
HttpClient {
install(ContentNegotiation) {
json(Json {
prettyPrint = true
isLenient = true
ignoreUnknownKeys = true
})
}
}
}
}
The project is kotlin multiplatform project supporting android, iOS and web. The ktor function is only triggered via web though but the code lives in the common
directory. Will appreciate any help on this - been stuck up on days with this!!Chrimaeon
01/12/2025, 7:40 PMChrimaeon
01/12/2025, 7:42 PM