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

Error when adding @tailwindcss/ui plugin #79

Closed
foxted opened this issue Apr 4, 2020 · 8 comments
Closed

Error when adding @tailwindcss/ui plugin #79

foxted opened this issue Apr 4, 2020 · 8 comments
Labels
bug Something isn't working has-workaround

Comments

@foxted
Copy link

foxted commented Apr 4, 2020

I am encountering an issue when using @tailwindcss/ui plugin. I followed the instructions, adding the plugin in tailwind.config.js:

module.exports = {
   ...
   plugins: [
        require('@tailwindcss/ui'),
    ]
}

But when running nuxt generate, I get this error:

ERROR in ./app/assets/css/tailwind.css (./node_modules/css-loader/dist/cjs.js??ref--3-oneOf-1-1!./node_modules/postcss-loader/src??ref--3-oneOf-1-2!./app/assets/css/tailwind.css)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Expected an opening square bracket.
    at /Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/tailwindcss/utilities.css:1:1
    at Root._error (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:137:24)
    at Root.error (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/selectors/root.js:43:25)
    at Parser.error (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:392:25)
    at Parser.expected (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:685:25)
    at Parser.missingSquareBracket (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:406:21)
    at Parser.parse (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:668:22)
    at Parser.loop (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:618:18)
    at new Parser (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:129:14)
    at Processor._root (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/processor.js:47:22)
    at Processor._runSync (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/processor.js:83:25)
    at Processor.processSync (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/processor.js:177:27)
    at getParsed (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/dist/index.js:34:59)
    at /Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss-minify-selectors/dist/index.js:196:39
    at /Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss/lib/container.js:239:18
    at /Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss/lib/container.js:135:18
    at AtRule.each (/Users/valentinprugnaud/Sites/Speakbox/speakbox-web-app/node_modules/postcss/lib/container.js:101:16)
 @ ./app/assets/css/tailwind.css 4:14-172
 @ ./.nuxt/App.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi ./.nuxt/client.js
@Atinux
Copy link
Collaborator

Atinux commented Apr 6, 2020

Hi @foxted

Indeed I have seen this issue popup recently, see tailwindlabs/tailwindcss#1190 (comment).

You can fix it by disabling the focus-within-pseudo-class in your nuxt.config.js:

 build: {
    postcss: {
      preset: {
        features: {
          // Fixes: https://github.com/tailwindcss/tailwindcss/issues/1190#issuecomment-546621554
          "focus-within-pseudo-class": false
        }
      }
    }
  }

@Atinux Atinux added bug Something isn't working has-workaround labels Apr 6, 2020
@manniL
Copy link
Contributor

manniL commented Apr 26, 2020

Resolved via csstools/postcss-focus-within#5 (but still not available)

@manniL manniL closed this as completed Apr 26, 2020
@manniL manniL reopened this Apr 30, 2020
@hmaesta
Copy link
Contributor

hmaesta commented Jun 10, 2020

I think this issue can be closed. I am using @tailwindcss/ui for a couple of days without problems.

@manniL
Copy link
Contributor

manniL commented Jun 12, 2020

Thanks for the info @hmaesta ☺️

@manniL manniL closed this as completed Jun 12, 2020
@benoit-ponsero
Copy link

still have this issue. can you re-open ?

@hmaesta
Copy link
Contributor

hmaesta commented Jul 13, 2020

Hey @benoit-ponsero.
Can you share your tailwind.config.js and nuxt.config.js?

Just created a Sandbox with Nuxt 2.13.3 + @nuxtjs/tailwindcss@^2.0.0 + @tailwind/ui 0.3.1 and it appears OK.

https://codesandbox.io/s/nuxt-tailwind-css-tailwind-ui-ekdqq?file=/tailwind.config.js

(Fork, open a new Terminal tab and run yarn generate)

@benoit-ponsero
Copy link

Hi @hmaesta,

You are right. @nuxtjs/tailwindcss was stuck in v1.4.1.

Seems to work since upgrading.

@ferdinanddoremus
Copy link

ferdinanddoremus commented Nov 7, 2020

For your information, I just spent a couple of hours having that same issue while trying to deploy on heroku with a NODE_ENV different from production. Only difference is I do not use tailwind-ui at all, only tailwind.
nuxt 2.14.0 & @nuxtjs/tailwindcss 2.1.0

The workaround from @Atinux seems to work fine, anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has-workaround
Projects
None yet
Development

No branches or pull requests

6 participants