An Interest In:
Web News this Week
- March 6, 2024
- March 5, 2024
- March 4, 2024
- March 3, 2024
- March 2, 2024
- March 1, 2024
- February 29, 2024
October 25, 2022 02:21 pm GMT
Original Link: https://dev.to/kenzysc/vite-internal-server-error-cannot-read-properties-of-undefined-reading-length-for-tailwind-and-postcss-5g7
[vite] Internal server error: Cannot read properties of undefined (reading 'length') for Tailwind and PostCSS.
Disclaimer: this is not a fix but rather a quick hack, so that, for instance, you might continue building.
Problem: You've just installed TailwindCSS but you get the error below as well as some indication that it might related to the PostCSS config.
$ [postcss] Cannot read properties of undefined (reading 'config')$ [vite] Internal server error: [postcss] Cannot read properties of undefined (reading 'config')
Quick Hack: Copy the content of module.export in the tailwind.config.js file into the value of the tailwindcss property in the postcss.config.js file. Your final result should look like this:
./postcss.config.js1 module.exports = {2 plugins: {3 tailwindcss: {4 content: [5 "./index.html",6 "./src/**/*.{vue,js,ts,jsx,tsx}",7 ],8 theme: {9 extend: {},10 },11 plugins: [12 require('@tailwindcss/forms'),13 ],14 },15 autoprefixer: {},16 },17 }
That should do the hack. Cheers.
Original Link: https://dev.to/kenzysc/vite-internal-server-error-cannot-read-properties-of-undefined-reading-length-for-tailwind-and-postcss-5g7
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To