o/
Just started a new personal project with Remix & TailwindCSS. Everything works fine with raw Remix install, but the css hot reload is broken when I add Tailwind. The first class added is applied, but not the next ones.
I think it must be related to WSL2 (Windows Subsystem for Linux), because it works fine on my linux laptop.
My config is exactly the one describe on Remix documentation.
Env
WSL2 with Ubuntu 20.04
node: v16.13.2 (also tried with v17.4.0)
npm: v8.4.0
app/root.tsx
...
import tailwindStylesUrl from "./tailwind.css";
export const links: LinksFunction = () => {
return [
{
rel: "stylesheet",
href: tailwindStylesUrl,
},
];
};
...
tailwind.config.js
module.exports = {
content: ["./app/**/*.{ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
};
package.json
...
"scripts": {
"build": "npm run build:css && remix build",
"build:css": "tailwindcss -o ./app/tailwind.css",
"dev": "concurrently \"npm run dev:css\" \"remix dev\"",
"dev:css": "tailwindcss -o ./app/tailwind.css --watch",
"postinstall": "remix setup node",
"start": "remix-serve build"
},
"dependencies": {
"@remix-run/react": "^1.1.3",
"@remix-run/serve": "^1.1.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"remix": "^1.1.3"
},
"devDependencies": {
"@remix-run/dev": "^1.1.3",
"@types/react": "^17.0.24",
"@types/react-dom": "^17.0.9",
"concurrently": "^7.0.0",
"tailwindcss": "^3.0.17",
"typescript": "^4.1.2"
},
...
console
$ npm run dev
> dev
> concurrently "npm run dev:css" "remix dev"
[0]
[0] > dev:css
[0] > tailwindcss -o ./app/tailwind.css --watch
[0]
[1] (node:16121) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
[1] (Use `node --trace-warnings ...` to show where the warning was created)
[1] (node:16121) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time
[1] Watching Remix app in development mode...
[1] πΏ Built in 258ms
[1] Remix App Server started at http://xxx.xx.xxx.xx:3000
[0]
[0] Rebuilding...
[0] Done in 117ms.
[1] πΏ File changed: app/tailwind.css
[1] πΏ Rebuilding...
[1] πΏ Rebuilt in 48ms
[0]
[0] Rebuilding...
[0] Done in 14ms.
[1] πΏ File changed: app/root.tsx
[1] πΏ Rebuilding...
[1] πΏ Rebuilt in 51ms
Thanks for your help π
/mnt/c
(or any other Windows drive by any chance? β Untinged/mnt/c/Users/MyUsername/project
β Coati