Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with Next.js 14 (typescript, eslint) #18

Closed
fschlegelone opened this issue Feb 18, 2024 · 1 comment
Closed

Issues with Next.js 14 (typescript, eslint) #18

fschlegelone opened this issue Feb 18, 2024 · 1 comment

Comments

@fschlegelone
Copy link

As you can see in the screenshot, I get an error when adding prefix & defaultFlavour to the tailwind config:
Type error: This expression is not callable.
Type 'typeof import("/opt/repos/projects/portfolio/node_modules/.pnpm/@catppuccin[email protected][email protected]/node_modules/@catppuccin/tailwindcss/dist/index")' has no call signatures.

CleanShot 2024-02-18 at 16 28 02@2x

When removing the prefix & defaultFlavour, it works..
CleanShot 2024-02-18 at 16 30 14@2x

@joulev
Copy link

joulev commented Feb 18, 2024

This is not related to Next.js. You can simply make a foo.js file with this content

// @ts-check
const foo = require("@catppuccin/tailwindcss");

foo({}); // TS error
foo.default({}); // TS is happy

to reproduce the error.

From a quick glance, the cause seems to be that @catppuccin/tailwindcss should've used export = instead of export default.

What you can do right now while waiting for this bug to be patched: use tailwind.config.ts instead where you can use ESM syntax

// tailwind.config.ts
import type { Config } from "tailwindcss";
import tailwindForms from "@tailwindcss/forms";
import catppuccin from "@catppuccin/tailwindcss";

const config: Config = {
  content: ['./app/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,tsx}', '.css/**/*.css'],
  theme: {},
  safelist: [
    // this is for demonstration purposes only, not required for basic usage
    {
      pattern: /bg-.+/,
    },
  ],
  plugins: [
    tailwindForms,
    catppuccin({
      prefix: 'one',
      defaultFlavour: 'mocha',
    }),
  ],
};

export default config;

@nekowinston nekowinston closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants