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

Tailwind Config: Why does module.exports work in my case, but export default doesn't? #953

Open
phillipmohr opened this issue Feb 9, 2025 · 0 comments
Labels
question Further information is requested

Comments

@phillipmohr
Copy link

phillipmohr commented Feb 9, 2025

  • I was getting the error main.css:1:1: The text-largeclass does not exist. Iftext-largeis a custom class, make sure it is defined within a@layer directive.
  • My package.json has this line "type": "module"
  • text-large is defined in my tailwind.config.ts:
module.exports = <Partial<Config>>{
  theme: {
    extend: {
      fontSize: {
        large: '1.3rem'
      },
...
  • I used it with the layer directive in my main.css
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    h2 {
        @apply text-large font-semibold;
    }
}

I was only able to fix the issue by changing export default to module.exports and I wonder why? Am I not using ECMA module due to the "type": "module" option in my package.json?

@phillipmohr phillipmohr added the question Further information is requested label Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant