“Module not found” error with Gatsby, Netlify CMS, and PostCSS

Your site uses Gatsby and Netlify CMS. Tailwind and PostCSS take care of the styling. You run gatsby develop, and encounter a cryptic error message.

Module not found: Error: Can't resolve './tailwindcss/base'

The problem is the plugin order in your gatsby-config.js file. The PostCSS plugin must appear before the Netlify CMS plugin. The correct order is as follows.

module.exports = {
  plugins: ['gatsby-plugin-postcss', 'gatsby-plugin-netlify-cms'],
}

Sign up for my newsletter

A monthly round-up of blog posts, projects, and internet oddments.