Skip to content

Not able to get it working #1

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
crittermike opened this issue Aug 21, 2018 · 17 comments
Closed

Not able to get it working #1

crittermike opened this issue Aug 21, 2018 · 17 comments

Comments

@crittermike
Copy link

Hey there, this looks awesome, I saw it from you posting it in the Tailwind slack!

So far I'm unable to get it working. In my case, my tailwind.js is in web/themes/custom/theme/tailwind.js and I'm testing using various filename.html.twig files inside web/themes/custom/theme/templates and it just doesn't seem to be doing anything. I don't see any autocomplete popup when typing class names.

I tried renaming the file to filename.twig or even filename.html (even though Twig seems to be supported, looking at https://github.com/bradlc/vscode-tailwindcss/blob/master/src/extension.ts#L18) just in case and that didn't help. None of them give me any kind of autocomplete for classes.

Any thoughts on what I could be missing? Or any info I could provide to help debug?

Thanks!

@bradlc
Copy link
Contributor

bradlc commented Aug 21, 2018

Hey! Thanks for creating an issue.

Looks like this was because the extension was only looking in the workspace root for the config file. I have pushed a fix in 0.1.2 – let me know if you still have issues

@bradlc
Copy link
Contributor

bradlc commented Aug 21, 2018

I’ll close this issue but feel free to reopen if needed

@bradlc bradlc closed this as completed Aug 21, 2018
@crittermike
Copy link
Author

@bradlc Sadly that didn't seem to do it for me. I confirmed that I updated to 0.1.2 and restarted VS Code a couple times to be safe. Let me know if you have any other ideas or info I could provide to be helpful.

(I'm unable to reopen this issue and it's possible that it's just a quirky edge case with my particular setup anyway)

@bradlc
Copy link
Contributor

bradlc commented Aug 21, 2018

Ah sorry I thought you could; I’ll reopen.

Are you using a multi-root workspace in VS Code?

@bradlc bradlc reopened this Aug 21, 2018
@crittermike
Copy link
Author

No I'm not using multi-root, but I think the issue may be that my node_modules actually lives in web/themes/custom/theme rather than at the project root. (It's a Drupal project and the Drupal theme is where the node_modules live rather than in the project root). It seems like that may mess this up: https://github.com/bradlc/vscode-tailwindcss/blob/master/src/extension.ts#L71

So I'm not sure if that's the kind of use case you want to support. Seems like it may be tough to dynamically find the tailwindcss node module regardless of where it lives in the project, unless you make that a configurable option or something. Feel free to re-close this as wontfix if you'd like!

@bradlc
Copy link
Contributor

bradlc commented Aug 21, 2018

Aah I see. Yeah if your node_modules isn’t in the root it won’t work currently. It uses the actual version of tailwindcss that you have installed.

I see two ways to solve this:

  • we look for **/node_modules/tailwindcss instead, to cover sub dirs
  • we fall back to the latest version of tailwindcss if we can’t find it at the root

What do you think?

@crittermike
Copy link
Author

Option 1 seems preferable to me just to be sure that versions match up, and hopefully that would be simpler to implement?

@bradlc
Copy link
Contributor

bradlc commented Aug 21, 2018

I guess the "proper" solution is to support multiple Tailwind versions/configs in a single project:

  • web/themes/foo
    • src
      • index.html
    • node_modules
      • tailwindcss
    • tailwind.js
  • web/themes/bar
    • src
      • index.html
    • node_modules
      • tailwindcss
    • tailwind.js

Which should be doable 🤔

@crittermike
Copy link
Author

Yeah I thought about that but didn't want to push my luck :D

I can see how that would be necessary if you have a project with multiple themes in the same codebase.

bradlc added a commit that referenced this issue Aug 21, 2018
@bradlc
Copy link
Contributor

bradlc commented Aug 21, 2018

Yeah definitely. I don’t think the use case is too common, but would still be good to support.

For now I have updated the extension (0.1.4) to look for **/node_modules/tailwindcss – hopefully that works for you for now!

@crittermike
Copy link
Author

@bradlc you are a hero, it works like a champ now!

@theMosaad
Copy link

This problem was reintroduced again in v0.3.0. I'm running v0.2.0 for the class suggestions to show up in a workspace where node_modules isn't in the root.

@lkruselarsen
Copy link

I am experiencing this issue in v0.5.0 v0.2.0 v0.1.4
maybe i am doing something else wrong. Tailwind is working in my project through

@TouseefQ
Copy link

I am experiencing the same issue with the Tailwind CSS IntelliSense extension in VSCode. I am using Tailwind with Wordpress. The extension was working fine before I merged everything with Wordpress but now it seems to be not working. Tailwind is working perfectly fine. Any suggestions on how we can fix the working of this extension (Tailwind CSS IntelliSense)?

@lkruselarsen
Copy link

so i created a new project from scratch, where i installed tailwindcss, postcss-cli and autoprefixer again. Only difference was that i had intellisense installed before project creation. now it works perfectly. no clue what was wrong first time around.

@pjayme
Copy link

pjayme commented Dec 1, 2020

The feature is working fine for .HTML files but have had no luck when trying to configure includeLanguages for a .ss (Silverstripe) template file. Have others had any luck with custom template languages?

@TouseefQ
Copy link

TouseefQ commented Dec 1, 2020

I am experiencing the same issue with the Tailwind CSS IntelliSense extension in VSCode. I am using Tailwind with Wordpress. The extension was working fine before I merged everything with Wordpress but now it seems to be not working. Tailwind is working perfectly fine. Any suggestions on how we can fix the working of this extension (Tailwind CSS IntelliSense)?

This solved my problem:

I deleted the package-lock.json file and the node_module folder and re-installed npm in my project. The tailwind IntelliSence extension for VSCode started working after this.

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

6 participants