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

Wrapped in PHP Symfony/Process with tty enabled cli crashes #16344

Open
mvanduijker opened this issue Feb 7, 2025 · 1 comment
Open

Wrapped in PHP Symfony/Process with tty enabled cli crashes #16344

mvanduijker opened this issue Feb 7, 2025 · 1 comment

Comments

@mvanduijker
Copy link

What version of Tailwind CSS are you using?

v4.0.4

What build tool (or framework if it abstracts the build tool) are you using?

tonysm/tailwindcss-laravel

What version of Node.js are you using?

NA

What browser are you using?

N/A

What operating system are you using?

macOS

Reproduction URL

I think it's more of an issue with tty support, but if required I can make a repo with a clean laravel install and tonysm/tailwind-css-laravel package.

Describe your issue

when running php artisan tailwind:watch (or build) it fails with the following error:

Building assets...
3605 |   if (typeof sink === "object")
3606 |     if (typeof sink.write === "function")
3607 |       return stream[_fileSink] = sink;
3608 |     else
3609 |       throw new Error("Invalid FileSink");
3610 |     return stream[_fileSink] = Bun.file(sink).writer();
                             ^
error: Invalid argument
 syscall: "kqueue",
   errno: -22,
    code: "EINVAL",

      at NativeWritable_lazyConstruct (node:stream:3610:53)
      at NativeWritablePrototypeWrite (node:stream:3613:65)
      at eprintln (/$bunfs/root/tailwindcss-macos-arm64:61742:23)
      at <anonymous> (/$bunfs/root/tailwindcss-macos-arm64:62001:13)

Bun v1.1.43 (macOS arm64)
Done!

It was working with 3.4.* releases.
When I remove the enabling of tty (https://github.com/tonysm/tailwindcss-laravel/blob/main/src/Commands/BuildCommand.php#L52) it starts working again. My guess it has something to do with tty support in the current released cli. Maybe other programming environments will have the same issue.

@mvanduijker mvanduijker changed the title Wrapped in PHP Symfony/Process with tty enabled it crashes Wrapped in PHP Symfony/Process with tty enabled cli crashes Feb 7, 2025
@mvanduijker
Copy link
Author

To reproduce with just PHP:

$descriptors = [
  ['file', '/dev/tty', 'r'],
  ['file', '/dev/tty', 'w'],
  ['file', '/dev/tty', 'w'],
];
$pipes = [];
proc_open('tailwindcss --help', $descriptors, $pipes, __DIR__, [], ['suppress_errors' => true, 'bypass_shell' => true]);

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

1 participant