Medala's avatar
Level 12

Cannot install Tailwindcss on a fresh laravel project

Is there an issue installing Tailwindcss on the latest laravel? I have spent four hours trying to make it work on a fresh project.

0 likes
12 replies
Sinnbeck's avatar

And what is the problem? Do you get an error or something?

Medala's avatar
Level 12

Hi Sinnbeck, thank you for answering, I deleted the project and I will recreate the problem just to make sure I follow the instructions correctly. It will take five minutes.. I got the error when I run "npm run dev". please check in five minutes.

Medala's avatar
Level 12

Working on it now.. I'll update the status in a bit.

Medala's avatar
Level 12

Thank Zivko, If I recall correctly, I tried this but it did not work .

Medala's avatar
Level 12

This one took me further than before, I don't have a problem with run dev anymore. Yup, it works. Thank you @sinnbeck.

Medala's avatar
Level 12

Thanks Siangboon, Sinbeck had also suggested the same link and it worked.

Zivko's avatar

Sorry @medala.

The problem is in the webpack.mix.js file which must look different from the video I shared.

const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');

mix.sass('resources/sass/app.scss', 'public/css')
    .options({
        processCssUrls: false,
        postCss: [tailwindcss('./tailwind.config.js')],
    });

Please or to participate in this conversation.