themesberg / flowbite-react

Official React components built for Flowbite and Tailwind CSS
https://flowbite-react.com
MIT License
1.89k stars 422 forks source link

Complex selectors in '.peer:focus ~ :is(.dark .peer-focus\:dark\:text-blue-500)' can not be transformed to an equivalent selector without ':is()'. #1065

Closed dimaslanjaka closed 10 months ago

dimaslanjaka commented 1 year ago

Steps to reproduce

https://github.com/dimaslanjaka/webpack-boilerplate/tree/b03ccaf

my scss stylesheet just

@tailwind base;
@tailwind components;
@tailwind utilities;

Current behavior

Just start dev server after yarn add flowbite-react and got errors:

Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
(1:1) from "postcss-is-pseudo-class" plugin: Complex selectors in '.peer:focus ~ :is(.dark .peer-focus\:dark\:text-blue-500)' can not be transformed to an equivalent selector without ':is()'.

Code:
  .peer:focus ~ :is(.dark .peer-focus\:dark\:text-blue-500){--tw-text-opacity:1;color:rgba(63, 131, 248, 1);color:rgba(63, 131, 248, var(--tw-text-opacity))}

Expected behavior

webpack server started when using "flowbite-react": "^0.4.9" but not when using "flowbite-react": "^0.6.4"

Context

console output web output

rluders commented 1 year ago

@dimaslanjaka what happens if you update the flowbite package to "flowbite": "^1.6.6"?

dimaslanjaka commented 1 year ago

@dimaslanjaka what happens if you update the flowbite package to "flowbite": "^1.6.6"?

same

image

dimaslanjaka commented 1 year ago

when using

{
    "flowbite": "^1.6.6",
    "flowbite-react": "^0.5.0"
}

works

image

ishigami commented 1 year ago

Hi guys,

I'm experiencing the same issue.

I'm using:

{
   "flowbite": "^2.0.0",
    "flowbite-react": "^0.6.4",
}
rluders commented 11 months ago

@ishigami @dimaslanjaka I have no idea what happens here, but... try to update to @beta and check if it still happening.

tulup-conner commented 10 months ago

This seems like it's out of scope for the project, but feel free to correct me if I'm wrong

thomasrea0113 commented 9 months ago

This seems like it's out of scope for the project, but feel free to correct me if I'm wrong

how would this be outside the scope of the project? Admittedly I know very little about the implementation, but the error indicates that the selector cannot be transformed to not use the :is() selector. seems pretty clear that it's an issue with one of the component classes. I'm wondering how this doesn't affect every build? I thought maybe specifying a browserlist that requires the latest version would resolve it, but it doesn't. Is there a way to disable the postcss-is-pseudo-class plugin altogether? I don't plan to support older browsers anyway.

dimaslanjaka commented 9 months ago

ahhhhhhh still not work after update

image image

dimaslanjaka commented 9 months ago

please correct my config project https://github.com/dimaslanjaka/webpack-boilerplate/tree/spring-fe

why this error still occurs when using flowbite-react@^0.6 !!!!!!

dimaslanjaka commented 9 months ago

when using below version, is working.

{
    "flowbite": "^2.2.1",
    "flowbite-react": "^0.5.0"
}

image image

dimaslanjaka commented 9 months ago

so i just update other dependencies except flowbite-react to get the project working https://github.com/dimaslanjaka/webpack-boilerplate/commit/9c7aedc261940ec28c81eabbd868bcc28fc9aaf3

image

dimaslanjaka commented 9 months ago

@ishigami @dimaslanjaka I have no idea what happens here, but... try to update to @beta and check if it still happening.

not work

image image