Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

319
Vistas
Tailwindcss not working with NextJS 12. Experimental features

When NextJS 12 released , i taught to build a project with tailwind.

my package.json

 {
  "name": "test",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "next": "12.0.1",
    "react": "^18.0.0-alpha-9c8161ba8-20211028",
    "react-dom": "^18.0.0-alpha-9c8161ba8-20211028"
  },
  "devDependencies": {
    "autoprefixer": "^10.4.0",
    "eslint": "7",
    "eslint-config-next": "12.0.1",
    "postcss": "^8.3.11",
    "tailwindcss": "^2.2.19"
  }
}

next.config.js file

 module.exports = {
  swcMinify: true,
  reactStrictMode: true,
  experimental: {
    concurrentFeatures: true,
    serverComponents: true,
  },
};

and as per nextjs documentaion we have to update our _document.js file

    import { Html, Head, Main, NextScript } from "next/document";

export default function Document() {
  return (
    <Html>
      <Head />
      <body>
        <Main />
        <NextScript />
      </body>
    </Html>
  );
}

im getting this wierd error Error

my global.css file

@tailwind base;
@tailwind components;
@tailwind utilities;

BUT , if i remove the experimental features it works just file

like so

module.exports = {
  swcMinify: true,
  reactStrictMode: true,
 
};

Strange, BUT it works after i build

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I followed the instructions on the offical page exactly.

  • it did not work in dev mode (next dev)
  • it did work, however in prod mode (next build && next start)

i added swcMinify: true to my next.config.js, now it works in both modes.

So my full next cofig is now

/** @type {import('next').NextConfig} */
const nextConfig = {
  swcMinify: true,
  reactStrictMode: true,
};

module.exports = nextConfig;
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda