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

@Tailwind Base no longer resolving in imported stylesheets #13732

Closed
7 tasks done
Sarenor opened this issue Jul 6, 2023 · 6 comments · Fixed by #13738
Closed
7 tasks done

@Tailwind Base no longer resolving in imported stylesheets #13732

Sarenor opened this issue Jul 6, 2023 · 6 comments · Fixed by #13738
Labels
feat: css p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release

Comments

@Sarenor
Copy link

Sarenor commented Jul 6, 2023

Describe the bug

I'm one of the people helping out with the development & maintenance of Skeleton for Svelte and starting with 4.4.0 of Vite, our way of handling CSS for our users doesn't work as expected anymore.
To make sure the order of imports & initializiation of tailwind layers is correct, we handle it in one of our CSS-Files (skeleton.css which imports tailwind.css which contains the directives) and the user only needs to import skeleton.css.

That approach worked perfectly up until Vite 4.3.9 (Downgrade the Vite version in the reproduction to see how it should actually look or at least used to look).

Now it gives the following error:

[postcss] postcss-import: [...]\my-skeleton-app\node_modules\.pnpm\@skeletonlabs+skeleton@1.9.0_svelte@3.59.2\node_modules\@skeletonlabs\skeleton\dist\styles\partials\core.css:3:1: `@layer base` is used but no matching `@tailwind base` directive is present.

Reproduction

https://github.com/Sarenor/vite-tailwind-reproduction

Steps to reproduce

Run (p)npm i, followed by (p)npm run dev, followed by opening the URL displayed in the console, the error should then appear in the console.

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-1260P
    Memory: 11.95 GB / 31.71 GB
  Binaries:
    Node: 18.13.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.2.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.6.3 - ~\AppData\Local\pnpm\pnpm.CMD
  Browsers:
    Edge: Spartan (44.22621.1848.0), Chromium (114.0.1823.67)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    vite: 4.4.0 => 4.4.0

Used Package Manager

pnpm

Logs

No response

Validations

@dgrebb
Copy link

dgrebb commented Jul 6, 2023

This has been killing me for the last ~20h. @Sarenor tip of the hat to you for putting in a detailed issue!

For anyone else who finds this, @4.3.9 works as expected.

dgrebb added a commit to dgrebb/dgrebb.com that referenced this issue Jul 6, 2023
@xieyuheng
Copy link

I meet the same problem with postcss 8.4.25 and vite 4.4.1.

vite v4.4.1 building for production...
✓ 25 modules transformed.
✓ built in 3.39s
[vite:css] [postcss] postcss-import: /home/xyh/mimor-official/mimor/src/styles/scrollbar.css:10:1: `@layer utilities` is used but no matching `@tailwind utilities` directive is present.
file: /home/xyh/mimor-official/mimor/src/styles/index.css:10:1
error during build:
CssSyntaxError: [postcss] postcss-import: /home/xyh/mimor-official/mimor/src/styles/scrollbar.css:10:1: `@layer utilities` is used but no matching `@tailwind utilities` directive is present.
    at Input.error (/home/xyh/mimor-official/mimor/node_modules/postcss/lib/input.js:106:16)
    at AtRule.error (/home/xyh/mimor-official/mimor/node_modules/postcss/lib/node.js:115:32)
    at normalizeTailwindDirectives (/home/xyh/mimor-official/mimor/node_modules/tailwindcss/lib/lib/normalizeTailwindDirectives.js:72:32)
    at /home/xyh/mimor-official/mimor/node_modules/tailwindcss/lib/processTailwindFeatures.js:30:98
    at plugins (/home/xyh/mimor-official/mimor/node_modules/tailwindcss/lib/plugin.js:38:63)
    at LazyResult.runOnRoot (/home/xyh/mimor-official/mimor/node_modules/postcss/lib/lazy-result.js:357:16)
    at LazyResult.runAsync (/home/xyh/mimor-official/mimor/node_modules/postcss/lib/lazy-result.js:286:26)
    at LazyResult.async (/home/xyh/mimor-official/mimor/node_modules/postcss/lib/lazy-result.js:160:30)
    at LazyResult.then (/home/xyh/mimor-official/mimor/node_modules/postcss/lib/lazy-result.js:436:17)

@sapphi-red sapphi-red added feat: css p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release labels Jul 7, 2023
@sapphi-red
Copy link
Member

This seems to be affected by #8400. Reverting that PR, makes the reproduction work.

@Sarenor
Copy link
Author

Sarenor commented Jul 7, 2023

Thanks for providing a quick fix!
I don't mean to be a bother, but could you provide an estimated timeline of when it will be included in a bugfix release?

It's a bit of a showstopper for us with every newly set up project via npm create svelte@latest my-app pulling in "vite": "^4.3.6" (and therefore 4.4.1 on install) and breaking our library...

@patak-dev
Copy link
Member

@Sarenor the fix has been released in vite@4.4.2

@Sarenor
Copy link
Author

Sarenor commented Jul 7, 2023

Thank you very much!

And sorry for not seeing the already released version...

dgrebb added a commit to dgrebb/dgrebb.com that referenced this issue Jul 8, 2023
dgrebb added a commit to dgrebb/dgrebb.com that referenced this issue Jul 9, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: css p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants