How to move styles folder to src folder in nextjs typescript with tailwindcss?
i'm using nextjs with typescript and tailwindcss. I want to move styles
folder to src
folder, i already added baseUrl
with value src
options in my tsconfig.json
file, but I got an error like this :
./node_modules/next/dist/compiled/css-loader/cjs.js??ruleSet[1].rules[2].oneOf[5].use[1]!./node_modules/next/dist/compiled/postcss-loader/cjs.js??ruleSet[1].rules[2].oneOf[5].use[2]!./node_modules/tailwindcss/tailwind.css
TypeError: Object.fromEntries is not a function
and how i move styles folder to src folder, i want to make my folder structure simpler. thank you
Solution 1:
Delete the .next
folder, then run the dev server again (with npm run dev
).
This worked in my case. I'm guessing it's some kind of caching issue. Obviously you'll need to change your tailwind.config.js
where the content should check ./src/**/*.{js,jsx,ts,tsx}
rather than ./pages/**/*.{js,jsx,ts,tsx}
.