-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Token autocompletion not working on utils [CodeSandbox] #291
Comments
Thank you for reporting it @hmbrg 🙌🏻 |
Are there any updates on this? I would love to contribute a fix for this, but I've been looking into this issue and I have no idea what causes it. Do you have any clues on what might be the problem here? The error even states that there is no utility registered. Installing vanilla stitches in the repo works just fine though. |
Hey guys @hmbrg it seems that Stitches has a problem with the latest Typescript version stitchesjs/stitches#947 A user shared a temporal solution: It was the way we solve it, hope it helps you |
Thanks for your response! Unfortunately, that doesn't fix it, and the codesandbox I provided in the issue doesn't use an affected typescript version. I've created a new codesandbox showing the issue next to the working "vanilla" stitches config: https://codesandbox.io/s/nextui-type-issue-5x128y?file=/pages/index.js Looking at the type of |
Hey @hmbrg the commented solution aims to "VSCode", however, I was checking the CodeSandbox and is not a "Typescript" template, I've created a new Codesanbox base on the https://codesandbox.io/s/stitches-token-nextui-tzufq0?file=/src/App.tsx It's also important to point out that is not a NextUI bug, we're waiting for the Stitches team to fix it as well |
In fact, I'm not getting any token completion on any CSS property, not only utils. This works when using Stitches on its own as shown in my second codesandbox. |
I'm very interested to try out Next UI as well but I've been getting really used to the level of typescript/intellisense integration provided natively by stitches. Not having access to type safety for the utils that NextUI adds to the stitches theme feels like a big loss here. @jrgarciadev Looking at the sandbox link you've provided, there is no intellisense for any of the utils let alone enforcing the correct values are used with the util (eg px) |
Hey @WonderPanda I'm glad you want to use NextUI, the IntelliSense problems on CodeSandbox are caused due to is not possible to set a custom |
Thanks for super quick response! I'll try things out in VsCode |
Hey @jrgarciadev, I'm sorry to chime in here again, but this is not working for me in VSCode either, even though we are not using the affected TypeScript version. |
Hey @hmbrg which Typescript version are you using? did you see this comment stitchesjs/stitches#947 (comment) ? |
Yes, I did. We are using the recommended version of "4.5.5". |
@hmbrg Could you try using the |
Here is a basic repo just like the CodeSandbox: https://github.com/hmbrg/nextui-autocomplete-issue/blob/main/pages/index.tsx#L7 The type of "p:" is of type Changing the typescript version to |
@hmbrg did you change also the vscode typescript version? or just the project version? |
Yes, I made VSCode use the workspace version, not changing that makes the The settings are set to: |
Hey @hmbrg could you please check the version you are using is set as follows: Notice that it has no the |
Just tried that, sadly it doesn't fix it for me. I updated my example repo here: https://github.com/hmbrg/nextui-autocomplete-issue/blob/main/pages/index.tsx#L7 Have you tried my repo? Does this work for you? If yes, maybe it's something else with my local setup. |
Hey @hmbrg I'm still trying to figure out why the Typescript/IntelliSense is not working on CodeSandbox, if you look at this example https://codesandbox.io/s/nextui-xxl-button-kbhbid?file=/App.js (Only JS) the autocomplete works 🤔 Regarding VsCode autocomplete it works for me here's a video (it's laggy because I tested it on Github Codespaces): |
Thanks for looking into this! I've noticed, that even in the video you provided, the |
Bump. Are there any news on this? I'm still trying to figure this out. |
…tability fix: #291 stitches compatability with typescript
Describe the bug
Autocomplete does not seem to work for utils right now. Inside of
css()
the utils are not even defined as a prop, they are only there if you create a media query withcss({"bp1": {"pt": ...}})
.Steps to reproduce
css()
orstyled()
functionI've created a CodeSandbox here: https://codesandbox.io/s/distracted-rain-s63rmp?file=/src/App.tsx
Expected behaviour
I would expect to get suggestions of the available tokens.
The text was updated successfully, but these errors were encountered: