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.

Content changes not detected in SvelteKit when using globs on Windows

See original GitHub issue

What version of Tailwind CSS are you using? v3.0.23

What build tool (or framework if it abstracts the build tool) are you using? “postcss”: “^8.4.6”,

What version of Node.js are you using? node 16.13.0 and also tried it with 14

What browser are you using? Firefox, also tried on Microsoft Edge

What operating system are you using? Windows

Reproduction URL https://github.com/saym97/portal-exp this is base sveltekit project with Tailwind 3.0 . if you run ‘npm run dev’ the correct style classes will be applied to tag classes in routes/index.svelte but try changing the bg-color to some other color, it won’t change unless you restart the server.

Describe your issue I wanted to update my current project to Tailwind 3.0 . I am using Sveltekit for my project. I followed the Tailwind Labs youtube guide to update. It updated successfully (because I could use shadow-color class after that). but every time I make changes to class of an element it just doesn’t update the style. It doesn’t generate the newly added class. I have to ‘npm run dev’ every time I make changes. I also tried adding the ‘watch:css’ with ‘npm run dev’ thinking may be tailwind is not tracking changes unless I explicitly run --watch alongside ‘run dev’ but no luck. **But I did found out that if I run both the --watch and dev command to start server, it tells me that my Content field in tailwind config.cjs is empty or missing but it’s not! if there was something wrong with content field then it wouldn’t generate classes at all even after restarting the server . ** module.exports = { content: ['./src/**/*.{html,js,svelte,ts}'], theme: { extend: {}, }, plugins: [], }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
thecrypticacecommented, Feb 23, 2022

If you are using WSL you can configure Vite internally to use polling and it should fix any issues:

const config = {
  kit: {
    adapter: adapter(),

    vite: () => ({
      server: {
        watch: {
          usePolling: true,
        }
      }
    }),
  }
}
1reaction
saym97commented, Feb 22, 2022

I have edited the description of my issue and included the reproduction repo. I hope this explain the problem . Thank you !!

Read more comments on GitHub >

github_iconTop Results From Across the Web

SvelteKit console error "window is not defined" when i import ...
I tried use a apexCharts after mount, but the error did not disappear. <script> import ApexCharts from 'apexcharts' import { onMount } from...
Read more >
Getting Started with SvelteKit: 10 Tips | Rodney Lab
Getting started with SvelteKit: 10 tips I learned building fast Svelte sites from tooling to integrating SEO components and Netlify config.
Read more >
Connect your content to SvelteKit - Sanity.io
In this guide, you will add the necessary code to a SvelteKit starter to pull in your content from your Sanity Content Lake....
Read more >
Configuration • Docs • SvelteKit
Your project's configuration lives in a svelte.config.js file at the root of your project. As well as SvelteKit, this config object is used...
Read more >
Let's learn SvelteKit by building a static Markdown blog from ...
This is a walkthrough of using SvelteKit to set up a prerendered static ... we'll add a +page.svelte file, to serve as the...
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