Skip to content

@apply causes vitejs to HMR all files until maximum call stack error. #7986

@brielov

Description

@brielov

What version of Tailwind CSS are you using?

3.0.23

What build tool (or framework if it abstracts the build tool) are you using?

Vite 2.8.6

What version of Node.js are you using?

v17.5.0

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

brielov/react-app

Describe your issue

When using tailwindcss + vite, if you use css modules with @apply, when you save any file, it will cause an infinite HMR loop. I'm reporting this here cause this only happens while using tailwind's apply directive.

TailwindCSS config

module.exports = {
  content: ["index.html", "src/**/*.tsx"],
  theme: {
    extend: {
      screens: {
        standalone: { raw: "(display-mode: standalone)" },
      },
    },
  },
  plugins: [require("@tailwindcss/forms")],
};

PostCSS config

module.exports = {
  plugins: [
    require("tailwindcss/nesting")(require("postcss-nesting")),
    require("tailwindcss"),
    require("autoprefixer"),
  ],
};
Screen.Recording.2022-03-29.at.13.40.18.mov

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions