ui icon indicating copy to clipboard operation
ui copied to clipboard

[bug]: CLI breaks tailwind.config.ts

Open lacymorrow opened this issue 1 year ago • 5 comments

Describe the bug

      fontFamily: {
        sans: [
          'Work Sans',
          'sans-serif',
          'Calibri',
          'Candara',
          'Segoe',
          'Segoe UI',
          'Optima',
          'Arial',
        ],
      },

Becomes

  		fontFamily: {
  			sans: [\n          'Work Sans',\n          'sans-serif',\n          'Calibri',\n          'Candara',\n          'Segoe',\n          'Segoe UI',\n          'Optima',\n          'Arial',\n        ]
  		},

Affected component/components

CLI

How to reproduce

Have multiple lines in your tw config and use the CLI

      fontFamily: {
        sans: [
          // This breaks
          'Work Sans',
        ],
      },
      fontFamily: {
        sans: [
          'Work Sans',
          'Or this',
        ],
      },

Affected component/components

CLI

How to reproduce

Have multiple lines in your tw config and use the CLI

      fontFamily: {
        sans: [
          // This breaks
          'Work Sans',
        ],
      },
      fontFamily: {
        sans: [
          'Work Sans',
          'Or this',
        ],
      },

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

Next 14/15

Before submitting

  • [X] I've made research efforts and searched the documentation
  • [X] I've searched for existing issues

lacymorrow avatar Nov 05 '24 20:11 lacymorrow

I have been getting errors concerning a dependency missing a comma ever since I ran pnpm dlx shadcn@latest -a -o

unnamed-lab avatar Nov 06 '24 02:11 unnamed-lab

I have been getting same error since 3 days, do you have any temporary solution for this until the bug is resolved, for me, some tailwind classes for colors or font sizes do not work, on next js 14/15.

asayushranjansinha avatar Nov 08 '24 18:11 asayushranjansinha

Fortunately, I found a blog which had the solution for this and I tried and it worked. Here is the solution and the link to blog. Replace existing content with this in the tailwind config content: [ './src/app/**/*.{ts,tsx}', './src/components/**/*.{ts,tsx}', './@/**/*.{ts,tsx}', ] This worked for me. Here is the link to blog https://remslabs.com/blog/quick-fix-for-tailwind-css-issues-in-next-js-13-with-shadcn-ui

asayushranjansinha avatar Nov 09 '24 04:11 asayushranjansinha

You can manually fix the TS file after running the CLI, or you can remove multiline comments from array objects beforehand.

lacymorrow avatar Nov 09 '24 05:11 lacymorrow

This issue has been automatically marked as stale due to one year of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you. (This is an automated message)

shadcn avatar Nov 09 '25 23:11 shadcn

This issue has been automatically closed due to one year of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding! (This is an automated message)

shadcn avatar Nov 16 '25 23:11 shadcn