エラー内容
1 2 3 4 5 6 7 8 9 10 11 12 |
[vite:css] [postcss] Cannot read properties of undefined (reading 'config') file: /var/www/html/simple/src/index.css:undefined:undefined error during build: TypeError: [postcss] Cannot read properties of undefined (reading 'config') at getTailwindConfig (/var/www/html/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:85:63) at /var/www/html/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:97:92 at /var/www/html/node_modules/tailwindcss/lib/processTailwindFeatures.js:46:11 at plugins (/var/www/html/node_modules/tailwindcss/lib/plugin.js:38:63) at LazyResult.runOnRoot (/var/www/html/simple/node_modules/postcss/lib/lazy-result.js:339:16) at LazyResult.runAsync (/var/www/html/simple/node_modules/postcss/lib/lazy-result.js:393:26) at LazyResult.async (/var/www/html/simple/node_modules/postcss/lib/lazy-result.js:221:30) at LazyResult.then (/var/www/html/simple/node_modules/postcss/lib/lazy-result.js:206:17) |
解決方法<\h2>
下記のファイルに、tailwindcss の設定内容を追記することで、エラーが解決できます。
./postcss.config.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
module.exports = { plugins: { tailwindcss: { content: [ "./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}", ], theme: { extend: {}, }, plugins: [ require('@tailwindcss/forms'), ], }, autoprefixer: {}, }, } |