brokenhandsio/leaf-error-middleware

got 'leaf-error-middleware' exists and is not an empty directory (-4)

chocoford opened this issue · 5 comments

In Package.swift:

dependencies: [
    ...,
    .package(name: "LeafErrorMiddleware", url: "https://github.com/brokenhandsio/leaf-error-middleware.git", from: "2.0.0")
],
targets: [
    .target(name: "App", dependencies: [
        ...,
        "LeafErrorMiddleware"
    ]),
    ...,
]

but got

Showing Recent Messages
An unknown error occurred. '/Users/.../SourcePackages/checkouts/leaf-error-middleware' exists and is not an empty directory (-4)

And in '/Users/.../SourcePackages/checkouts', the leaf-error-middleware folder is indeed an empty folder.

0xTim commented

@chocoford try doing a clean and rebuild. Is this from the command line? If so, removing the .build directory should fix it

@0xTim it is ok when running vapor build. But the message is from Xcode.
And I had just try to fix the problem by copy leaf-error-middleware from .build directory to my Xcode Derive Data path.
However, after fetching all packages, Xcode still show the message above and the copied leaf-error-middleware folder become empty again.

0xTim commented

Yeah I wouldn't mess with Derived Data. I would delete your derived data, do a clean and delete the .swiftpm directory - that should fix the error

@0xTim Thanks. It has been solved. I will close the issue.