Mokshit06 / typewind

The safety of Typescript with the magic of Tailwind.
https://typewind.dev/
MIT License
2.23k stars 23 forks source link

Typecheck failing – generated TS definition file appears to be invalid? #56

Closed sebpowell closed 6 months ago

sebpowell commented 9 months ago

Hi there,

Thanks for this package, I was just playing around with it and it looks really great.

I've been having an issue however when running a type check on my project. I was able to get everything working, but when I run a typecheck like so: tsc --noEmit, I get the following error:

Screenshot 2023-12-30 at 14 53 49

If I look at the file in questions, it doesn't seem to be valid TS:

Screenshot 2023-12-30 at 14 54 35

I initially thought it might be an issue with my project, but I was able to replicate this error using the the Next.js example provided here: https://typewind.vercel.app/docs/examples/next

I downloaded the repo, and then tried running the typecheck as described above, and got the same error.

Any ideas what the problem might be? As far as I'm aware, the syntax the package is generating is not valid TS, irrespective of version, so not sure what the problem is. Thank you in advance.

I7ace commented 8 months ago

Downgrade the tailwind version to 3.3.*

mutewinter commented 7 months ago

57 up with a fix for Tailwind 3.4. You can use my PR right now if needed:

# Yarn 2+
yarn add 'typewind@https://gitpkg.now.sh/mutewinter/typewind/packages/typewind?fix-tailwind-3.4-build'

# Yarn 1
yarn add 'https://gitpkg.now.sh/mutewinter/typewind/packages/typewind?fix-tailwind-3.4-build'

# NPM
npm install 'https://gitpkg.now.sh/mutewinter/typewind/packages/typewind?fix-tailwind-3.4-build'
Mokshit06 commented 7 months ago

Hi, thanks for reporting! This is definitely an issue with Typewind, and #57 fixes it 🙂