Spinning up the sanity studio gets me this error. The page spins up just fine in local host. Any help fixing this would be greatly appreciated
here is the error in full:
[plugin:vite:css] [postcss] Cannot read properties of undefined (reading 'config')
at getTailwindConfig (/Users/adamsmith/Desktop/codingprojects/portfolio/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:84:63)
at /Users/adamsmith/Desktop/codingprojects/portfolio/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:96:92
at /Users/adamsmith/Desktop/codingprojects/portfolio/node_modules/tailwindcss/lib/processTailwindFeatures.js:46:11
at plugins (/Users/adamsmith/Desktop/codingprojects/portfolio/node_modules/tailwindcss/lib/index.js:38:63)
at LazyResult.runOnRoot (/Users/adamsmith/Desktop/codingprojects/portfolio/portfolio-build/node_modules/postcss/lib/lazy-result.js:339:16)
at LazyResult.runAsync (/Users/adamsmith/Desktop/codingprojects/portfolio/portfolio-build/node_modules/postcss/lib/lazy-result.js:393:26)
at LazyResult.async (/Users/adamsmith/Desktop/codingprojects/portfolio/portfolio-build/node_modules/postcss/lib/lazy-result.js:221:30)
at LazyResult.then (/Users/adamsmith/Desktop/codingprojects/portfolio/portfolio-build/node_modules/postcss/lib/lazy-result.js:206:17)
at processTicksAndRejections (node:internal/process/task_queues:96:5
This is the contents of my tailwind.config.js file
@type {import('tailwindcss').Config}
module.exports = {
content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [
require('tailwind-scrollbar')
],
}
I ended up creating a tailwind.config.js file in the sanity folder with the following information. It fixed it.
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
'./app/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
plugins: [],
}
When you create the tailwindcss, Ensure that the content array is not empty, do add the following:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
'./app/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
plugins: [],
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With