Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

tailwind css is not working after deploy on vercel/netlify #8874

Answered by ichenglin
saiful-shaakil asked this question in Help
Discussion options

Last 2 days, I'm trying to figure out the problem in my google-clone project. It is working fine on my localhost but not working fine after deploying it on vercel/netlify.
GitHub link of my project: https://github.com/saiful-shaakil/new-google-clone
Vercel live site link : https://google-clone-using-nextjs.vercel.app/

You must be logged in to vote

I'm not quite sure whether or not this was the issue,
but in tailwind.config.js you specified the content path to be "./components/**/*.{js,ts,jsx,tsx}",
while the actual source folder was named Components.

Maybe try editing the fifth line of tailwind configuration file and see if it works?
Navigate to tailwind.config.js and replace the line below

"./components/**/*.{js,ts,jsx,tsx}",

with

"./Components/**/*.{js,ts,jsx,tsx}",

Replies: 17 comments 44 replies

Comment options

I'm not quite sure whether or not this was the issue,
but in tailwind.config.js you specified the content path to be "./components/**/*.{js,ts,jsx,tsx}",
while the actual source folder was named Components.

Maybe try editing the fifth line of tailwind configuration file and see if it works?
Navigate to tailwind.config.js and replace the line below

"./components/**/*.{js,ts,jsx,tsx}",

with

"./Components/**/*.{js,ts,jsx,tsx}",
You must be logged in to vote
33 replies
Comment options

thanks for saving my days!

Comment options

Thanks a lot ...

Comment options

thanks a lot sir , i am also suffering 3 day

Comment options

Thank you so much.

Comment options

With all the AI, All the Stack overflow this answer should be everywhere! It was my fix as well in 2025

Answer selected by saiful-shaakil
Comment options

Thanks a lot. you made my day. I was stuck for two days. I found this article and solved the problem.

You must be logged in to vote
0 replies
Comment options

Thanks so much its also work for me

You must be logged in to vote
0 replies
Comment options

thank you so much ..

You must be logged in to vote
0 replies
Comment options

lol. found the same issue. still sometimes you need google to resolve your issue. Otherwise, I was too dependent on chatGPT. Thanks a lot.

You must be logged in to vote
0 replies
Comment options

Hey guys, good afternoon!, can anyone help me? I have the same problem, but I couldn't solve it :(

GitHub link of my project: https://github.com/wilkker/page_tailwindcss
Vercel live site link : https://pagina-npr5jc8v7-wilkker.vercel.app/

You must be logged in to vote
1 reply
Comment options

wongjn Jan 6, 2024
Collaborator

Your live site link seems to be forcing me to login. Regardless, consider checking your paths. If your webroot is set to src, then the <link> to the CSS in src/index.html should be href="/output.css" or href="./output.css":

 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <title>Page</title>
- <link rel="stylesheet" href="/src/output.css">
+ <link rel="stylesheet" href="/output.css">
 </head>
Comment options

nextjs 14

if you are facing this issue in nextjs

Navigate to tailwind.config.ts and replace the line below and replace the content

 content: [
 "./Components/**/*.{js,ts,jsx,tsx}",
 "./src/**/*.{js,ts,jsx,tsx,mdx}",
 "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
 "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
 ],
You must be logged in to vote
3 replies
Comment options

It's work

Comment options

Its working now, thank you

Comment options

Thank you brother

Comment options

Hey guys, good afternoon!, can anyone help me? I am also having the same problem, but I couldn't solve it :(

GitHub link of my project: https://github.com/PriyankaSoni03/Razorpay-Clone
Vercel live site link : https://razorpay-clone-gz6j-git-main-priyankasoni03s-projects.vercel.app/

You must be logged in to vote
4 replies
Comment options

@PriyankaSoni03 . the build command is missing from your package.json

Comment options

Can you please specify that what command or lines should I add. As I am bit confused in this

Comment options

i added this is package.json file
and then run **npm run build**

{
 "scripts": {
 "start": "vite",
 "build": "vite build"
 },
 "devDependencies": {
 "autoprefixer": "^10.4.19",
 "postcss": "^8.4.38",
 "tailwindcss": "^3.4.1",
 "vite": "^5.2.6"
 }
}

After build process is completed , you will see dist folder .There you will see the build files that you can upload to any hosting. You can check tutorials on how to deploy static apps in vercel .

Comment options

Thank You so much!! Its now working.

Comment options

If you are using tailwind then check you folder name if it is camel case then go to tailwind.config.ts and set your folder name this is find the content and check the spelling ( content: [ './pages/**/*.{js,ts,jsx,tsx,mdx}', './Components/**/*.{js,ts,jsx,tsx,mdx}', './app/**/*.{js,ts,jsx,tsx,mdx}', )
...
On Fri, 5 Apr 2024 at 7:36 PM, PriyankaSoni03 ***@***.***> wrote: Can you please specify that what command or lines should I add. As I am bit confused in this — Reply to this email directly, view it on GitHub <#8874 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AMNMC6AJG3QS3OZDHE6F5CDY32ZIRAVCNFSM532DHJZ2U5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TSMBSGI2TAOI> . You are receiving this because you are subscribed to this thread.Message ID: <tailwindlabs/tailwindcss/repo-discussions/8874/comments/9022509@ github.com>
You must be logged in to vote
0 replies
Comment options

hi all
i bulid the project react+taiwind but when i deploy the project tailwind is not working
here my tailwind config
/** @type {import('tailwindcss').Config} /
export default {
content: [
"./index.html",
"./src/**/
.{js,jsx,ts,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
github link:https://github.com/mpal15/Book_explorer.git
vercel deploy link:https://book-explorer-woad.vercel.app/

You must be logged in to vote
1 reply
Comment options

Step 1: Add this in package.json file
{
"scripts": {
"start": "vite",
"build": "vite build"
},
"devDependencies": {
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.1",
"vite": "^5.2.6"
}
}
Step 2: and then run npm run build
Step 3: After build process is completed , you will see "dist" named folder .There you will see the build files that you can upload to any hosting platform.

Alternative to the above steps is just host it on netlify, it will host your website directly by making dist file.
Hope this helps!!

Comment options

thank for help but is not working github link:https://github.com/mpal15/Book_explorer.git deploy link:https://book-explorer-red.vercel.app/
...
On 2024年4月11日 at 18:46, PriyankaSoni03 ***@***.***> wrote: Step 1: Add this in package.json file { "scripts": { "start": "vite", "build": "vite build" }, "devDependencies": { "autoprefixer": "^10.4.19", "postcss": "^8.4.38", "tailwindcss": "^3.4.1", "vite": "^5.2.6" } } Step 2: and then run *npm run build* Step 3: After build process is completed , you will see "dist" named folder .There you will see the build files that you can upload to any hosting platform. Alternative to the above steps is just host it on netlify, it will host your website directly by making dist file. Hope this helps!! — Reply to this email directly, view it on GitHub <#8874 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AO2FGVZNPK2M22RPT3ZFLMLY42ELZAVCNFSM532DHJZ2U5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TSMBYGQYTEMY> . You are receiving this because you commented.Message ID: ***@***.*** com>
You must be logged in to vote
1 reply
Comment options

check your tailwind installation , redo it , check after running npm run build , then npm run preview if its working or not. Make sure you are importing all the necessary CSS files

Comment options

The code is in your master branch vercel did’t accept code code from master brach push your code to main instead of master
...
On 2024年4月11日 at 7:06 PM, Mohit Pal ***@***.***> wrote: thank for help but is not working github link:https://github.com/mpal15/Book_explorer.git deploy link:https://book-explorer-red.vercel.app/ On 2024年4月11日 at 18:46, PriyankaSoni03 ***@***.***> wrote: > Step 1: Add this in package.json file > { > "scripts": { > "start": "vite", > "build": "vite build" > }, > "devDependencies": { > "autoprefixer": "^10.4.19", > "postcss": "^8.4.38", > "tailwindcss": "^3.4.1", > "vite": "^5.2.6" > } > } > Step 2: and then run *npm run build* > Step 3: After build process is completed , you will see "dist" named > folder .There you will see the build files that you can upload to any > hosting platform. > > Alternative to the above steps is just host it on netlify, it will host > your website directly by making dist file. > Hope this helps!! > > — > Reply to this email directly, view it on GitHub > < #8874 (reply in thread)>, > or unsubscribe > < https://github.com/notifications/unsubscribe-auth/AO2FGVZNPK2M22RPT3ZFLMLY42ELZAVCNFSM532DHJZ2U5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TSMBYGQYTEMY> > . > You are receiving this because you commented.Message ID: > ***@***.*** > com> > — Reply to this email directly, view it on GitHub <#8874 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AMNMC6A6UDXFYTUMO5CHSR3Y42KGLAVCNFSM532DHJZ2U5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TSMBYGQ3TOMY> . You are receiving this because you are subscribed to this thread.Message ID: <tailwindlabs/tailwindcss/repo-discussions/8874/comments/9084773@ github.com>
You must be logged in to vote
0 replies
Comment options

If your css not working then ( If you are using tailwind then check you folder name if it is camel case then go to tailwind.config.ts and set your folder name this is find the content and check the spelling ( content: [ './pages/**/*.{js,ts,jsx,tsx,mdx}', './Components/**/*.{js,ts,jsx,tsx,mdx}', './app/**/*.{js,ts,jsx,tsx,mdx}', ) ) On 2024年4月11日 at 7:35 PM, Saqlain Kazmi ***@***.***> wrote:
...
The code is in your master branch vercel did’t accept code code from master brach push your code to main instead of master On 2024年4月11日 at 7:06 PM, Mohit Pal ***@***.***> wrote: > thank for help but is not working > github link:https://github.com/mpal15/Book_explorer.git > deploy link:https://book-explorer-red.vercel.app/ > > On 2024年4月11日 at 18:46, PriyankaSoni03 ***@***.***> > wrote: > > > Step 1: Add this in package.json file > > { > > "scripts": { > > "start": "vite", > > "build": "vite build" > > }, > > "devDependencies": { > > "autoprefixer": "^10.4.19", > > "postcss": "^8.4.38", > > "tailwindcss": "^3.4.1", > > "vite": "^5.2.6" > > } > > } > > Step 2: and then run *npm run build* > > Step 3: After build process is completed , you will see "dist" named > > folder .There you will see the build files that you can upload to any > > hosting platform. > > > > Alternative to the above steps is just host it on netlify, it will host > > your website directly by making dist file. > > Hope this helps!! > > > > — > > Reply to this email directly, view it on GitHub > > < > #8874 (reply in thread)>, > > > or unsubscribe > > < > https://github.com/notifications/unsubscribe-auth/AO2FGVZNPK2M22RPT3ZFLMLY42ELZAVCNFSM532DHJZ2U5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TSMBYGQYTEMY> > > > . > > You are receiving this because you commented.Message ID: > > ***@***.*** > > com> > > > > — > Reply to this email directly, view it on GitHub > <#8874 (comment)>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AMNMC6A6UDXFYTUMO5CHSR3Y42KGLAVCNFSM532DHJZ2U5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TSMBYGQ3TOMY> > . > You are receiving this because you are subscribed to this thread.Message > ID: <tailwindlabs/tailwindcss/repo-discussions/8874/comments/9084773@ > github.com> >
You must be logged in to vote
0 replies
Comment options

I had the same issue...named my folder Components and had "./components/**/*.{js,ts,jsx,tsx}", in the config file, just changed it to a capital C and all worked upon deployment

You must be logged in to vote
0 replies
Comment options

Hi all!
After deploying my page to netlify I ran into a few problems like 404 error, or a blank page being displayed - I managed them (one due to my repository being nested inside another folder, blank display - I removed the dist folder from git.ignore). The last one I can’t overcome - my tailwind/css isn’t applied at all.

Path to the css in index.html seems to be correct, the folder structure of dist too, all the tailwind and vite config as well as pacage.json seem to be correct too, all is up to date. Since my repository is nested inside another folder my build settings are as below:
Screenshot 2024年12月25日 at 20 05 39
It seems like I’ve tried everything and can not find the source of the issue, could you please take a look and help me?

Here is my repository: GitHub - MagdaMie/website
and here my website: https://profound-dolphin-3faf78.netlify.app/

You must be logged in to vote
0 replies
Comment options

Somebody can help me? Thanks
Same iussue :(

github link: https://github.com/SudatiSimone/sito-imgigi
deploy link: https://sito-imgigi.vercel.app/

You must be logged in to vote
0 replies
Comment options

If you need any support to solve the tailwind css issues kindly knock me. I will try to solve your problem.
...
On Tue, Aug 5, 2025 at 10:44 PM Sudati Simone ***@***.***> wrote: Somebody can help me? Thanks Same iussue :( github link: https://github.com/SudatiSimone/sito-imgigi deploy link: https://sito-imgigi.vercel.app/ — Reply to this email directly, view it on GitHub <#8874 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/A5AKGVAVWASSLUSFEZEMKG33MDNO7AVCNFSM532DHJZ2U5DIOJSWCZC7NNSXTOSENFZWG5LTONUW63SDN5WW2ZLOOQ5TCNBQGA4TAMZQ> . You are receiving this because you commented.Message ID: ***@***.*** com>
-- Md. Ashraful Islam MERN Stack Developer Email: ***@***.*** Phone: +8801777112564 Dhaka, Bangladesh <https://github.com/Darkasfu> <https://www.linkedin.com/in/ashrafulislamm/> <https://mdashrafulislam.netlify.app/>
You must be logged in to vote
1 reply
Comment options

I'm building a UI package based on TailwindCSS that provides components for Astro/React/Svelte/Vue. How can I ensure that in projects using this package, the TailwindCSS build only scans the components from the Components folder that have actually been imported at least once in the project?

If I specify the node_modules/mypackage/components folder as a source, then both the Input and Button components end up in the final generated output - even if, for example, the Input component wasn't used a single time.

I'm interested in a solution compatible with both v3 and v4 for compatibility reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /