Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Loading @tailwindcss/forms seems to cause a PostCSS error (next.js) #59

@christofferbergj

Description

@christofferbergj

Repo: https://github.com/christofferberg/jit/tree/main/

I've tried to setup Tailwind JIT in a Nextjs project and everything seems to work fine, until I require @tailwindcss/forms in the plugins array of the tailwind.config.js file.

Error:

Unknown error from PostCSS plugin. Your current PostCSS version is 8.1.7, but postcss-preset-env uses 7.0.35. Perhaps this is the source of the error below.
error - ./styles/globals.css ((webpack)/css-loader/cjs.js??ref--5-oneOf-6-1!(webpack)/postcss-loader/cjs.js??ref--5-oneOf-6-2!./styles/globals.css)
RangeError: Maximum call stack size exceeded
    at Function.keys (<anonymous>)

tailwind.config.js:

module.exports = {
  purge: [],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [
    require("@tailwindcss/forms"), // Loading this creates error: Unknown error from PostCSS plugin. Your current PostCSS version is 8.1.7, but postcss-preset-env uses 7.0.35. Perhaps this is the source of the error below.
    require("@tailwindcss/typography"),
    require("tailwindcss-debug-screens"),
  ],
};

postcss.config.js

module.exports = {
  plugins: [
    "@tailwindcss/jit",
    "postcss-nesting",
    "postcss-flexbugs-fixes",
    [
      "postcss-preset-env",
      {
        autoprefixer: {
          flexbox: "no-2009",
        },
        stage: 3,
        features: {
          "custom-properties": false,
        },
      },
    ],
  ],
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions