Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imperial fails compiling with Vapor updates #111

Open
mynona opened this issue Dec 3, 2024 · 1 comment
Open

Imperial fails compiling with Vapor updates #111

mynona opened this issue Dec 3, 2024 · 1 comment

Comments

@mynona
Copy link

mynona commented Dec 3, 2024

255.2 /build/Sources/App/Modules/Authentication/OAuth/ImperialRouter+Controller.swift:28:11: error: type 'any ResponseEncodable' does not conform to the 'Sendable' protocol
255.2  26 |       return try Google
255.2  27 |          .getUser(on: request)
255.2  28 |          .flatMap { userInfo in
255.2     |           `- error: type 'any ResponseEncodable' does not conform to the 'Sendable' protocol
255.2  29 |             Author
255.2  30 |                .query(on: request.db)
255.2 
255.2 /build/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift:7:17: note: protocol 'ResponseEncodable' does not conform to the 'Sendable' protocol
255.2  5 | ///
255.2  6 | /// Types that conform to this protocol can be returned in route closures.
255.2  7 | public protocol ResponseEncodable {
255.2    |                 `- note: protocol 'ResponseEncodable' does not conform to the 'Sendable' protocol
255.2  8 |     /// Encodes an instance of `Self` to a `Response`.
255.2  9 |     ///
255.2 
255.2 /build/Sources/App/Modules/Authentication/OAuth/ImperialRouter+Controller.swift:3:1: warning: add '@preconcurrency' to treat 'Sendable'-related errors from module 'Vapor' as warnings
255.2   1 | 
255.2   2 | import ImperialGoogle
255.2   3 | import Vapor
255.2     | `- warning: add '@preconcurrency' to treat 'Sendable'-related errors from module 'Vapor' as warnings
255.2   4 | import Fluent
255.2   5 | 
255.2 
255.2 /build/Sources/App/Modules/Authentication/OAuth/ImperialRouter+Controller.swift:33:17: error: type 'any ResponseEncodable' does not conform to the 'Sendable' protocol
255.2  31 |                .filter(\.$username == userInfo.email)
255.2  32 |                .first()
255.2  33 |                .flatMap { foundUser in
255.2     |                 `- error: type 'any ResponseEncodable' does not conform to the 'Sendable' protocol
255.2  34 | 
255.2  35 |                   guard
255.2 
255.2 /build/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift:7:17: note: protocol 'ResponseEncodable' does not conform to the 'Sendable' protocol
255.2  5 | ///
255.2  6 | /// Types that conform to this protocol can be returned in route closures.
255.2  7 | public protocol ResponseEncodable {
255.2    |                 `- note: protocol 'ResponseEncodable' does not conform to the 'Sendable' protocol
255.2  8 |     /// Encodes an instance of `Self` to a `Response`.
255.2  9 |     ///
@0xTim
Copy link
Member

0xTim commented Dec 3, 2024

Running Vapor apps in the Swift 6 language mode is problematic at the moment - you should use Swift 5 language mode. Can you show your code? Because it might be a workaround (and see what you're trying to return as Sendable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants