I use tailwind v4 for the first time on my projects. I use yarn and in dev mode it works fine, but when i want to deploy to vercel, or execute yarn build, i receive the following error:
MacBook-Pro-2:next-app xxx$ yarn build
yarn run v1.22.22
$ next build
▲ Next.js 15.2.3
Creating an optimized production build ...
<w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|/Users/xxx/Desktop/Web/pb/next-app/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[2]!/Users/xxx/Desktop/Web/pb/next-app/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[3]!/Users/xxx/Desktop/Web/pb/next-app/app/styles/globals.css': No serializer registered for PostCSSSyntaxError
<w> while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> webpack/lib/ModuleBuildError -> PostCSSSyntaxError
Failed to compile.
./app/styles/globals.css:2:6138
Syntax error: tailwindcss: /Users/xxx/Desktop/Web/pb/next-app/app/styles/globals.css Missed semicolon
1 | /*! tailwindcss v4.0.15 | MIT License | */
Node.js version is: v20.17.0
globals.css
@import "tailwindcss";
:root {
--color-primary: #b90305;
--color-primaryAccent: #cdd7de;
--color-secondary: #dbdbdb;
--color-secondaryAccent: #f3f6f8;
--color-black: #080b0d;
}
i installed tailwind same as in this instruction:
package.json
{
"name": "next-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"lucide-react": "^0.483.0",
"next": "15.2.3",
"postcss": "^8.5.3",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-hook-form": "^7.54.2"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.0.15",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"tailwindcss": "^4.0.15",
"typescript": "^5"
}
}
postcss.config.mjs
export default {
plugins: { "@tailwindcss/postcss": {} },
};
if you need more informations about my project, please let me know.
I want to deploy my Next.js Project to vercel or want to execute yarn build.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744357815a4570318.html
评论列表(0条)