I have the following Tailwind CSS config file.
// See the Tailwind default theme values here:
// https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js
const colors = require('tailwindcss/colors');
const defaultTheme = require('tailwindcss/defaultTheme');
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{html,js,ts,jsx,tsx}'],
// All the default values will be compiled unless they are overridden below
theme: {
// Extend (add to) the default theme in the `extend` key
extend: {
colors: {
// Create your own at: https://javisperez.github.io/tailwindcolorshades
primary: colors.blue,
secondary: colors.emerald,
tertiary: colors.gray,
danger: colors.red,
gray: colors.neutral,
'code-400': '#fefcf9',
'code-600': '#3c455b',
},
fontFamily: {
sans: ['Inter', ...defaultTheme.fontFamily.sans],
serif: ['IBM Plex Serif', ...defaultTheme.fontFamily.serif],
},
},
},
plugins: [
require('@tailwindcss/typography'),
require('@tailwindcss/forms'),
require('@tailwindcss/aspect-ratio'),
require('@tailwindcss/container-queries'),
require('tailwindcss-debug-screens'),
],
// Opt-in to TailwindCSS future changes
future: {},
};
I am using Parcel to run the server and get the following error:
???? Build failed.
@parcel/transformer-postcss: Cannot find module '@tailwindcss/typography'
Require stack:
- /Users/harshamv/Sites/tailwind-starter/tailwind.config.js
Error: Cannot find module '@tailwindcss/typography'
Require stack:
- /Users/harshamv/Sites/tailwind-starter/tailwind.config.js
at Function._resolveFilename (node:internal/modules/cjs/loader:1224:15)
at Function.resolve (node:internal/modules/helpers:190:19)
at _resolve (/Users/harshamv/Sites/tailwind-starter/node_modules/jiti/dist/jiti.js:1:251148)
at jiti (/Users/harshamv/Sites/tailwind-starter/node_modules/jiti/dist/jiti.js:1:253746)
at /Users/harshamv/Sites/tailwind-starter/tailwind.config.js:32:5
at evalModule (/Users/harshamv/Sites/tailwind-starter/node_modules/jiti/dist/jiti.js:1:256443)
at jiti (/Users/harshamv/Sites/tailwind-starter/node_modules/jiti/dist/jiti.js:1:254371)
at /Users/harshamv/Sites/tailwind-starter/node_modules/tailwindcss/lib/lib/load-config.js:52:30
at loadConfig (/Users/harshamv/Sites/tailwind-starter/node_modules/tailwindcss/lib/lib/load-config.js:54:6)
at getTailwindConfig (/Users/harshamv/Sites/tailwind-starter/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:71:116)
I tried install the plugins manually and try but still getting the same error.