webpack-contrib / postcss-loader

PostCSS loader for webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Loading PostCSS "tailwindcss" plugin failed: Cannot find module 'tailwindcss'

ptgamr opened this issue · comments

Bug report

Upgrading to latest version of postcss - https://github.com/postcss/postcss/releases/tag/8.4.16

Build failed with standard configuration of webpack + postcss-loader + tailwindcss

Loading PostCSS "tailwindcss" plugin failed: Cannot find module 'tailwindcss'

Downgrade to 8.4.14 the build is fine again

Actual Behavior

Build failed

Expected Behavior

Build should not failed

How Do We Reproduce?

// webpack config
      {
        test: /\.tailwind\.css$/i,
        use: [
          'style-loader',
          {loader: 'css-loader', options: {importLoaders: 1}},
          'postcss-loader',
        ],
      },

// postcss.config.js
module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
}

// tailwind.config.js
module.exports = {
  mode: 'jit',
  future: {
    removeDeprecatedGapUtilities: true,
    purgeLayersByDefault: true,
  },
  content: ['./src/**/*.tsx'],
  theme: {},
  variants: {},
  plugins: [],
  corePlugins: {
    preflight: false,
  },
}


It means you don't have installed tailwindcss

I'm sure tailwindcss is installed - that's why "Downgrade to 8.4.14 the build is fine again"

Sounds like a bug in PostCSS, we don't have 8.4.14 version, we just PostCSS runner, not more, can you create reproducible test repo?

am having the same problem here

Closing due to inactivity. Please test with latest version and feel free to reopen if still regressions. Thanks!