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

'HTTPURLResponse' is unavailable #49

Open
mustachedkdev opened this issue Dec 13, 2019 · 3 comments
Open

'HTTPURLResponse' is unavailable #49

mustachedkdev opened this issue Dec 13, 2019 · 3 comments

Comments

@mustachedkdev
Copy link

remote: /app/.build/checkouts/S3/Sources/S3/Extensions/S3+Private.swift:15:107: error: use of undeclared type 'URLRequest'
remote: func make(request url: URL, method: HTTPMethod, headers: HTTPHeaders, data: Data? = nil, cachePolicy: URLRequest.CachePolicy = .useProtocolCachePolicy, on container: Container) throws -> Future {
remote: ^~~~~~~~~~
remote: /app/.build/checkouts/S3/Sources/S3/Extensions/S3+Private.swift:27:29: error: use of undeclared type 'URLRequest'
remote: func execute(_ request: URLRequest, on container: Container) -> Future {
remote: ^~~~~~~~~~
remote: /app/.build/checkouts/S3/Sources/S3/Extensions/S3+Private.swift:51:58: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
remote: static func convert(foundationResponse httpResponse: HTTPURLResponse, data: Data?, on worker: Worker) -> HTTPResponse {
remote: ^~~~~~~~~~~~~~~
remote: Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
remote: public typealias HTTPURLResponse = AnyObject
remote: ^
remote: /app/.build/checkouts/S3/Sources/S3/Extensions/S3+Private.swift:16:23: error: use of unresolved identifier 'URLRequest'
remote: var request = URLRequest(url: url, cachePolicy: cachePolicy)
remote: ^~~~~~~~~~
remote: /app/.build/checkouts/S3/Sources/S3/Extensions/S3+Private.swift:30:9: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
remote: URLSession.shared.dataTask(with: request, completionHandler: { (data, urlResponse, error) in
remote: ^~~~~~~~~~
remote: Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
remote: public typealias URLSession = AnyObject

@mustachedkdev
Copy link
Author

Seems like there should be come conditional imports depending on linux or mac environment

@daSkier
Copy link

daSkier commented Jan 4, 2020

@mustachedkdev @rafiki270 I'm running into this issue as well on Docker with swift:5.1.3-xenial. Have you found any work arounds or solutions?

@proggeramlug
Copy link

Use this here on master, it’s the fix: https://github.com/skelpo/s3-vapor3

PR coming soon too ;)

martinlasek added a commit to martinlasek/S3 that referenced this issue Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants