shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
74.7k stars 4.64k forks source link

[bug]: global.scss errors when Sass comments // exist #5610

Open kerryj89 opened 2 weeks ago

kerryj89 commented 2 weeks ago

Describe the bug

If global.scss file has comments in Sass form // then npx shadcn@latest add ... errors out.

Affected component/components

n/a

How to reproduce

  1. Create a global.scss file if you don't have one
  2. Make sure it has @tailwind directives (since this is how shadcn/ui determines the global file)
  3. Add a Sass comment anywhere in file, e.g. // Testing comment
  4. Run npx shadcn@latest add button
  5. Get error (see Logs section)

Codesandbox/StackBlitz link

No response

Logs

Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

<css input>:69:22: Unknown word

Sometimes you'll get Unknown string depending on the order of things.


### System Info

```bash
Apple M1 Pro
Node v21.5.0
shadcn@2.1.2

Before submitting

fresonn commented 1 week ago

+1 I just switched this // comment to /* comment */ and got success project initialization.