Skip to content

[BUG] - npm project init creates incorrect tailwind.config.js module export type #148

@Neil-Jubinville

Description

@Neil-Jubinville

HeroUI Version

2.4.2

Describe the bug

Using " npx heroui-cli@latest init "

Right after the npm init and install , when trying to 'npm run dev' you will encounter module not found for tailwind.

FIX: tailwind.config.js should generate this for a working module export

import { heroui } from "@heroui/theme";

/** @type {import('tailwindcss').Config} /
const config = {
content: [
"./index.html",
'./src/layouts/**/
.{js,ts,jsx,tsx,mdx}',
'./src/pages//*.{js,ts,jsx,tsx,mdx}',
'./src/components/
/.{js,ts,jsx,tsx,mdx}',
"./node_modules/@heroui/theme/dist/**/
.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
darkMode: "class",
plugins: [heroui()],
};

export default config; // ✅ Use ESM export instead of module.exports

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

see bug desc.

Expected behavior

It should load.

Screenshots or Videos

No response

Operating System Version

windows

Browser

Chrome

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