Skip to content

tailwindcss-intellisense not working correctly with sveltekit #291

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

Closed
Yiak opened this issue Apr 1, 2021 · 9 comments
Closed

tailwindcss-intellisense not working correctly with sveltekit #291

Yiak opened this issue Apr 1, 2021 · 9 comments

Comments

@Yiak
Copy link

Yiak commented Apr 1, 2021

1. Auto suggestions don’t show up at all.

I have tried everything mentioned in #151 & #252 and still no luck.
I tried both on pc and mac and none of them worked properly.

My VSCode version info on PC and mac:

Version: 1.55.0 (user setup)
Commit: c185983a683d14c396952dd432459097bc7f757f
Date: 2021-03-30T16:01:55.261Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.19042

Version: 1.55.0
Commit: c185983a683d14c396952dd432459097bc7f757f
Date: 2021-03-30T16:01:05.981Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 20.3.0

2. @apply in the comment will cause the highlighting to be inaccurate.

eg:
Before:
1
After:
2

To reproduce:

  1. Disable all VSCode extensions except Svelte for VS Code and Tailwind CSS IntelliSense
  2. Run followings in an empty directory:
npm init svelte@next
npx svelte-add tailwindcss --jit
npm install 
@MstrBlonde
Copy link

I'm guessing this may be caused by the absence of a tailwind.config.js or tailwind.js file, which according to the readme is required for the intellisense to work. The svelte-add package creates a tailwind.config.cjs file.

@Yiak
Copy link
Author

Yiak commented Apr 8, 2021

I'm guessing this may be caused by the absence of a tailwind.config.js or tailwind.js file, which according to the readme is required for the intellisense to work. The svelte-add package creates a tailwind.config.cjs file.

@MstrBlonde Thank you for your help. According to #198 , the extension should accept cjs file since version 0.5.5 …

@MstrBlonde
Copy link

I just happened to notice a new version of the plugin was pushed yesterday, and now I've got working intellisense in my SvelteKit project! Hopefully it works for you as well. Good luck!

@csenio
Copy link

csenio commented Apr 9, 2021

for me it's the other way around, 0.5.10 breaks it completely while 0.5.9 works fine

@bradlc
Copy link
Contributor

bradlc commented Jul 12, 2021

Hey @Yiak. I can't reproduce the issue 🤔 Are you seeing anything in the output panel? You can view this using the Tailwind CSS: Show Output command.

@Yiak
Copy link
Author

Yiak commented Jul 13, 2021

@bradlc Thank you for the command. Here's the output:

[Error - 7:45:22 PM] Tailwind CSS: Can't resolve 'tailwindcss' in 'c:\Users\xxx\Documents\tailwind'
Error
    at new g (c:\Users\xxx\.vscode\extensions\bradlc.vscode-tailwindcss-0.6.13\dist\server\tailwindServer.js:56:279180)
    at c:\Users\xxx\.vscode\extensions\bradlc.vscode-tailwindcss-0.6.13\dist\server\tailwindServer.js:56:346192
    at Generator.next (<anonymous>)
    at o (c:\Users\xxx\.vscode\extensions\bradlc.vscode-tailwindcss-0.6.13\dist\server\tailwindServer.js:56:339494)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

And I have uploaded a svelte-kit+tailwindcss sample here, just in case you wanna have a look.

@JonathanLafey
Copy link

Adding the windicss plugin provides all the necessary tailwind intellisense (at least that I used) without the need to install the actual windicss package.

This should be regarded as a temporary workaround though.

@bradlc
Copy link
Contributor

bradlc commented Jan 17, 2022

@Yiak Is this still an issue with the latest version of the extension (v0.7.6)?

@Yiak
Copy link
Author

Yiak commented Jan 17, 2022

@bradlc Everything looks good with the latest version of the extension. Thank you for your effort.

@Yiak Yiak closed this as completed Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants