-
Notifications
You must be signed in to change notification settings - Fork 70
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
TypeScript responsive variants missing custom screens on Vercel #189
Comments
Another update: I've found a reliable workaround that feels better than previous attempts, though not great. Further information: It looks like it's somehow related to how Vercel caches Current Workaround: Our current workaround involves forcefully generating the
Could be worse 🤷🏼 I'm not really sure how to further address the issue as I would expect the Happy for any further insight. Also happy to roll this into our base and move forward with it if there's no further insights at this time. |
Update: I've opened a support ticket with Vercel to investigate on their end as well. In the meanwhile, if there's interest in troubleshooting further, I've setup a pubic minimal reproducible repository which can be cloned/forked and deployed to Vercel to immediately see the error: https://github.com/gearbox-built/tailwind-variants-vercel |
Update: Vercel suggests that it's solely the responsibility of the package and falls out of their scope of support. I am not familiar enough with tailwind's JIT compiler, how it relates to the Can anyone (@mskelton?) lend some understanding around how the |
@troymcginnis I don't use |
@troymcginnis I don't have any idea of how to fix your issue, but your documentation is top notch!!! |
Hi @troymcginnis, could you please provide a repository to reproduce the issue or please share the versions of The I can't reproduce this issue here https://github.com/tianenpang/nextui-demo The build logs |
@tianenpang Repository to reproduce available here: https://github.com/gearbox-built/tailwind-variants-vercel. |
So, as we understood, generateTypes is running before resolving our tailwind config, and it does not have access to our types.
|
Describe the bug
When developing locally, the types for
responsiveVariants
appears to pick up all of our custom screens from ourtailwind.config.js
. This means we're able to see, get autocomplete for, and build components using our custom screens such asxs
and3xl
usingtv()
. However, if we're referencing any of these custom screens, our builds are breaking on Vercel stating:It looks like the default Tailwind screens are being generated rather than the custom screens—though only on Vercel (works locally but we haven't tested this anywhere else other than locally and Vercel).
My assumption is that this has something to do with our
generated.d.ts
file forTVGeneratedScreens
. I'm unsure how to proceed without doing something hacky in TS to get our builds to succeed on Vercel or if I'm just doing something inappropriate.This is our
tailwind.config.ts
setup:And the component raising the TS error on Vercel:
Note that we can see all of the correct screens here:
Vercel error:
To Reproduce
Steps to reproduce the behavior:
screens
in yourtailwind.config.ts
tv
local config to setresponsiveVariants
totrue
Note: If I use a standard screen size (ie.
'sm' | 'md' | 'lg' | 'xl' | '2xl'
, there's no error)Expected behavior
No build error and everything works as expected as it does locally.
Screenshots
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: