fluid-tailwind icon indicating copy to clipboard operation
fluid-tailwind copied to clipboard

Node 20.18.3+ compatibility

Open joshuafredrickson opened this issue 11 months ago • 3 comments

Attempting to use fluid-tailwind with any Node version above 20.18.3 throws the following error. This error does not occur if switching back to Node 20.18.3.

│ │ Module build failed (from ../node_modules/postcss-loader/dist/cjs.js):
│ │ SyntaxError
│ │ (6:3) resources/styles/common/global.css The `~text-base/lg` class does not exist. If `~text-base/lg` is a custom class, make
│ │ sure it is defined within a `@layer` directive.
│ │   4 | 
│ │   5 | :root {
│ │ > 6 |   @apply ~text-base/lg;
│ │     |   ^

Full tailwind.config.js:

import fluid, {extract, screens, fontSize} from 'fluid-tailwind';

/** @type {import('tailwindcss').Config} config */
const config = {
  content: {
    files: ['./app/**/*.php', './resources/**/*.{php,vue,js,jsx}'],
    extract,
  },
  theme: {
    fontSize,
    screens,
  },
  corePlugins: {},
  plugins: [
    fluid,
  ],
};

export default config;

joshuafredrickson avatar Feb 10 '25 17:02 joshuafredrickson

any updates on this?

mgorabbani avatar Oct 10 '25 00:10 mgorabbani

When I import "tailwindcss/defaultTheme"; in my tailwind.config before fluid-tw, then I dont have this error, which is just a workaround.

gluharry avatar Nov 06 '25 13:11 gluharry

This is another workaround, without importing defaultTheme:

const require = createRequire(import.meta.url);
const { extract, screens, default: fluid } = require("fluid-tailwind");

gluharry avatar Nov 06 '25 13:11 gluharry