0

I tried to install Tailwindcss 2.x on the nuxtJS boilerplate from NetlifyCMS, but on dev build, i've got this error: Module build failed (from ./node_modules/css-loader/dist/cjs.js): CssSyntaxError (3:18) Expected an opening square bracket.

I'm thinking that the error appear only when purgeCSS is not triggered, because there is no problem on production build.

I tried with tailwindcss 1.9 but there is no problems.

2 Answers 2

1

Instead of using Nuxt.js boilerplate from Netlify, you can follow the tailwind Nuxt.js installation guide here

Sign up to request clarification or add additional context in comments.

Comments

0

As explained in @nuxt/tailwind official documentation, Nuxt was still using PostCSS 7 and just upgraded to PostCSS 8 few days ago (Nuxt 2.15.0), so the core team is doing the migration to TailwindCSS 2.x right now.
@atinux is busy preparing his talk for VueJS Amsterdam right now, so the release will pretty much be on the first or second week of March.

You can either wait for the next release of the TailwindCSS official module, or use the solution provided in the first link aka

yarn add --dev tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9

Also, as @Qayyum Shareef, I do recommend using the official module for some serious support and easier debugging.

2 Comments

Yeah i had already the good version. I don't know why this error happened. This morning, I restarted a new project with the nuxt boilerplate from netlifyCMS website, and i've upgraded tailwindcss, and no error... with the same config, same dependancies. Btw, thanks to you two for trying to help me and thanks for the release information, it's a good news. I validate your comment, because it's the good way to update Tailwindcss.
Haha, thanks ! Do you have a repo to show us ? Why do you want that much to use the boilerplate from Netlify ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.