인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

인프런 커뮤니티 질문&답변

jihun6548님의 프로필 이미지

작성한 질문수

[코드캠프] 부트캠프에서 만든 '완벽한' 프론트엔드 코스

[04-03] CSS-Module

tailwindcss 오류관련 문의 드립니다 ㅠㅠ

해결된 질문

작성

·

53

0

버젼이 달라서인지.. CNA 했을 때
tailwind.config.js 파일이 없었습니다.
강의에서는 원래부터 존재하던데..
그래서 어떻게어떻게 추가를 했는데.

Error: It looks like you're trying to use tailwindcss directly as a PostCSS plugin. The PostCSS plugin has moved to a separate package, so to continue using Tailwind CSS with PostCSS you'll need to install @tailwindcss/postcss and update your PostCSS configuration.
라는 에러가 끝나지를 않네요 ㅠ
GPT한테 열심히 물어봤는데 도저히 해결이 안돼서 문의드립니다.
밑은 제가 설정해둔 코드입니다.

tailwind.config.js

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    "./src/**/*.{js,ts,jsx,tsx,html,css}", // 필요한 파일들 포함
    "./app/**/*.{js,ts,jsx,tsx}", // Next.js의 `app` 폴더 추가
    "./components/**/*.{js,ts,jsx,tsx}", // 컴포넌트 폴더 추가
  ],
  theme: {
    extend: {
      colors: {
        철수가좋아하는색깔: "#3498db", // 나만의 부트스트랩 만들기
        영희가좋아하는색깔: "green",
      },
    },
  },
  plugins: [],
};

 

postcss.config.js

module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
};

 

globals.css

/* @import "tailwindcss"; */

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

로 해도 안되고,
@import "tailwindcss"; 도 안됩니다...

답변 1

0

노원두님의 프로필 이미지
노원두
지식공유자

안녕하세요! jihun6548님!

nextjs 15버전에 출시됨에따라 강의에서 설치했던 버전과 달라졌어요!
(학습자료에도 반영 완료되었습니다!)

 

따라서, nextjs 설치시 14버전으로 설치해 주세요!

// nextjs 14버전으로 설치하는 방법
npx create-next-app@14