tailwindcss-postcss8 Tailwind Templates

Tailwindcss Postcss8

Tailwindcss PostCSS 8 compatibility issue

Here are the steps to reproduce the issue:

# Install project dependencies
yarn

# Run the project
yarn dev

Build will fail with an error message like below:

TypeError: Cannot read property 'charCodeAt' of undefined

Open ./postcss.config.js and comment out require("tailwindcss"). Webpack builds successfully. Webpack dev server runs at http://localhost:3000/.

Downgrade PostCSS plugins that uses PostCSS 8.

postcss-import 12.0.1 is not requiring PostCSS 8, so we leave it and remove other plugins as well as postcss.

# Remove PostCSS and some plugins
yarn remove postcss autoprefixer postcss-loader

# Add older versions of autoprefixer and postcss-loader
yarn add [email protected] [email protected]

Enable tailwindcss in postcss.config.js again and then run yarn dev.

Now all should work as expected.

Top categories

Loading Svelte Themes