Hello, apologies if this has been asked before. I tried integrating SwiftyTailwind with an existing Vapor project, and despite SwiftyTailwind correctly finding the binary, I'm getting the following error when I try to actually run the Vapor project.
[ INFO ] Tailwind: /var/folders/cl/pm3kms754_zg_17w7d8_9d_r0000gq/T/SwiftyTailwind/v3.4.3/tailwindcss-macos-arm64 init
[ WARNING ] posix_spawn error: Permission denied (13), `["/var/folders/cl/pm3kms754_zg_17w7d8_9d_r0000gq/T/SwiftyTailwind/v3.4.3/tailwindcss-macos-arm64", "init"]`
Swift/ErrorType.swift:200: Fatal error: Error raised at top level: posix_spawn error: Permission denied (13), `["/var/folders/cl/pm3kms754_zg_17w7d8_9d_r0000gq/T/SwiftyTailwind/v3.4.3/tailwindcss-macos-arm64", "init"]`
I then attempted running chmod +x tailwindcss-macos-arm64
in the Package directory (even though this seemed like it should be handled by the package code) and got the following, slightly different error.
[ INFO ] Tailwind: /var/folders/cl/pm3kms754_zg_17w7d8_9d_r0000gq/T/SwiftyTailwind/v3.4.3/tailwindcss-macos-arm64 init
[ WARNING ] posix_spawn error: Malformed Mach-o file (88), `["/var/folders/cl/pm3kms754_zg_17w7d8_9d_r0000gq/T/SwiftyTailwind/v3.4.3/tailwindcss-macos-arm64", "init"]`
Swift/ErrorType.swift:200: Fatal error: Error raised at top level: posix_spawn error: Malformed Mach-o file (88), `["/var/folders/cl/pm3kms754_zg_17w7d8_9d_r0000gq/T/SwiftyTailwind/v3.4.3/tailwindcss-macos-arm64", "init"]`
Tailwind configuration:
import Leaf
import SwiftyTailwind
import TSCBasic
import Vapor
func tailwind(_ app: Application) async throws {
let resourecesDirectory = try AbsolutePath(validating: app.directory.resourcesDirectory)
let publicDirectory = try AbsolutePath(validating: app.directory.publicDirectory)
let tailwind = SwiftyTailwind()
try await tailwind.initialize()
try await tailwind.run(
input: .init(validating: "Styles/app.css", relativeTo: resourecesDirectory),
output: .init(validating: "styles/app.generated.css", relativeTo: publicDirectory),
options: .content("\(app.directory.viewsDirectory)**/*.leaf")
)
}
// configures your application
public func configure(_ app: Application) async throws {
app.views.use(.leaf)
try await tailwind(app)
app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))
try routes(app)
}
This seems like there is something potentially wrong with the library code, but it's hard for me to tell for sure as I'm not only new to Tailwind, but also to Vapor. Please let me know if any more information is necessary or if there is a step I missed. Thank you!
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too