question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

šŸ› BUG: Unable to use Tailwind CSS with Snowpack.

See original GitHub issue

Quick checklist

  • I am using the latest version of Snowpack and all plugins.

What package manager are you using?

npm

What operating system are you using?

Windows

Describe the bug

Hi I am using React, Tailwind CSS and Sass with Typescript, and canā€™t manage to get the snowpack dev server to ā€œrecompileā€ the SCSS file upon adding a new Tailwind CSS class in my .tsx files.

There have been previous bug reports about this problem, and some of them have stated that the problem had been fixed (for them) but I could not resolve the issue on my end.

Note Iā€™m coming from a Webpack background after hearing about the improved live update times, so I do not fully understand all the options of Snowpack. Feel free to suggest any fixes in my config files, and any help is appreciated.

My project is setup using this template, and has a very specific tree that I would like to maintain if that is possible.

All configuration and testing files will be available in a minimal GitHub repository (shown below).

Steps to reproduce

  1. Clone the repository below.
  2. Run the following commands:
npm install
npx snowpack dev 
# Alternatively: npm run start
  1. Follow the steps shown on the webpage (webpage contents in src/App.tsx).

Error! dist/index.css (on localhost) does not update when a new Tailwind CSS class is added. It (the Tailwind CSS class) is added only when the SCSS file itself is modified.

Expectation: Snowpack should automatically invoke the SCSS recompile when a .tsx etc. file is modified.

Link to minimal reproducible example (optional)

https://github.com/Tarang74/snowpack-react-tailwind-sass-typescript

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17

github_iconTop GitHub Comments

1reaction
LouieMartincommented, Jan 10, 2022

I really really really want to have an index.scss and tailwind still recompiles correctly šŸ˜¦

0reactions
Tarang74commented, Jan 14, 2022

nope it doesnt work if in the src/ folder still has .scss file rename it to index.css

did this atleast work?

btw did this work?

Iā€™m not sure what you want me to do?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tailwind CSS - Snowpack
Tailwind is a popular class-based CSS utility library. Loading it in Snowpack is easy, and only requires a few steps!
Read more >
Snowpack and postcss-import? - Stack Overflow
Finally I found a solution, that worked for me: remove the postcss-import plugin: The import is done by Snowpack. everywhere use relativeĀ ...
Read more >
Snowpack for Svelte development revisited - codechips
The author of the SVG library has fixed it after I filed a bug report. PostCSS + TailwindCSS#. Snowpack has no PostCSS support...
Read more >
csssyntaxerror: tailwindcss: | The AI Search Engine You Control
remove the postcss-import plugin: The import is done by Snowpack. everywhere use relative paths ( ./colors.css or ../../colors.css ); @importĀ ...
Read more >
tailwind css snowpack setup - YouTube
tailwind css snowpack setupPlease Subscribe:-https://www.youtube.com/channel/UCpOHt5d6GG-mvo-_pU06rhQ?sub_confirmation=1Happy CodingĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found