Back

Swift Functions Appwrite/Client.swift Compile Error

  • 0
  • Self Hosted
  • Functions
  • Apple
SonOfBoo
13 Mar, 2024, 05:52

I'm getting this strange error when compiling the latest version of sdk-for-swift (5.0.0)

TypeScript
[961/962] Compiling Appwrite Client.swift
/usr/local/server/.build/checkouts/sdk-for-swift/Sources/Appwrite/Client.swift:40:83: error: type 'HTTPClient.EventLoopGroupProvider' has no member 'singleton'
    private static var eventLoopGroupProvider = HTTPClient.EventLoopGroupProvider.singleton
                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~

/usr/src/code/src/Executor/Executor.php:96
#0 /usr/src/code/src/Appwrite/Platform/Workers/Builds.php(408): Executor\Executor-

Locally this works fine. Also, I can see that this variable does exist on an extension HTTPClient.EventLoopGroupProvider https://github.com/swift-server/async-http-client/blob/main/Sources/AsyncHTTPClient/HTTPClient.swift#L893

Any ideas?

TL;DR
Developers are facing a compile error while using the latest version of sdk-for-swift (5.0.0) due to a missing member 'singleton' in HTTPClient.EventLoopGroupProvider. The solution is to update the code that is referencing the member to the correct implementation, which can be found in the provided link to the extension.
SonOfBoo
13 Mar, 2024, 05:54

I forgot to mention that my appwrite server is Version 1.5.1. Also, i've tried clearing the .build/ cache directory, but i'm getting the same failure message.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more