tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Tailwind CSS not working in WSL

Open thisisrishabh22 opened this issue 1 year ago • 10 comments

What version of Tailwind CSS are you using?

I'm using the gem tailwindcss-rails which has tailwindcss v3.2.4

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

I'm not using any build tool since I'm using Rails 7 with import maps.

What version of Node.js are you using?

v16.17.0

What browser are you using?

Firefox

What operating system are you using?

WSL Ubuntu 20.04

Reproduction URL tailwind-rails-bug

Describe your issue

I'm trying to use tailwindcss in my rails app using the official documentation, but unable to run the app since tailwindcss is not working in my WSL system. I opened an issue Help with tailwindcss-rails setup, the team informed me to open a bug report since the binary file is causing the problem.

thisisrishabh22 avatar Jan 05 '23 05:01 thisisrishabh22

Hey! You are getting an error because you are on a 32-bit system and installing / running a 64-bit binary. We do not compile binaries for 32-bit linux because pkg (the tool we use to package node + tailwindcss into a standalone binary) doesn't support it. I don't think Node.js itself has official builds for 32-bit linux which is probably why it's not supported by pkg.

Unfortunately, I don't have a workaround other than using a 64-bit system because building a binary for 32-bit linux isn't possible currently.

thecrypticace avatar Jan 05 '23 16:01 thecrypticace

Hi, @thecrypticace I'm actually using a 64-bit system.

Linux LAPTOP-O1H43SIF 4.4.0-22621-Microsoft #608-Microsoft Fri Jan 01 08:00:00 PST 2016 x86_64 x86_64 x86_64 GNU/Linux

thisisrishabh22 avatar Jan 05 '23 16:01 thisisrishabh22

@thisisrishabh22

What about your windows installation? Is it 32-bit and emulating 64-bit linux? The ELF… message indicates that the system you are on does not understand the ELF 64-bit executable format. I'm running the same version of Ubuntu in WSL2 on my Windows machine and things run fine.

Can you provide output from the following two commands in WSL?

  • file ./tailwindcss-linux-x64 (you'll need to be in the appropriate folder)
  • file /bin/ls

thecrypticace avatar Jan 05 '23 17:01 thecrypticace

@thecrypticace

I'm using a windows 11 machine with a 64-bit operating system, x64-based processor

Here are the output for the commands:

  • file ./tailwindcss-linux-x64
./tailwindcss-linux-x64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
  • file /bin/ls
/bin/ls: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=2f15ad836be3339dec0e2e6a3c637e08e48aacbd, for GNU/Linux 3.2.0, stripped

thisisrishabh22 avatar Jan 05 '23 17:01 thisisrishabh22

@thisisrishabh22

What happens if you download the binary directly from our releases page? Can you run that one?

wget https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-linux-x64
chmod +x ./tailwindcss-linux-x64
./tailwindcss-linux-x64 --help

thecrypticace avatar Jan 05 '23 17:01 thecrypticace

I've tried running the binary file directly from the releases page as well. You can check the output here

thisisrishabh22 avatar Jan 05 '23 17:01 thisisrishabh22

The only difference that I can discern between my WSL installation and yours is the kernel version. I'm apparently running kernel 4.19 whereas you are on 4.4. I don't know if there's maybe a bug there. But seems unlikely.

What shell are you using?

thecrypticace avatar Jan 05 '23 17:01 thecrypticace

I'm currently using zsh

and while running ./tailwindcss-linux-x64 --help I got this as the output

zsh: exec format error: ./tailwindcss-linux-x64

thisisrishabh22 avatar Jan 05 '23 17:01 thisisrishabh22

I'm not sure what's going on here. Whatever this is it has something to do with your install of WSL not recognizing some ELF binaries which is very strange. Ultimately, I don't know that there's anything we can do to fix this since I can confirm that the binary runs fine on WSL and other linux x64 systems.

Do you have Discord? Any chance you could pop in our help channel and @-mention me there? https://tailwindcss.com/discord

thecrypticace avatar Jan 05 '23 17:01 thecrypticace

Yes, I've discord with me, I'll ping you there!

thisisrishabh22 avatar Jan 06 '23 05:01 thisisrishabh22

Gonna move this to discussions as it's almost certainly a environment based problem and not a problem with our binaries and the discussion is continuing in Discord until we track down the source of the problem anyway.

thecrypticace avatar Jan 12 '23 16:01 thecrypticace