Skip to content

Intellisense not working on Windows for some projects / setups (v0.12.x) #988

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
emirefek opened this issue Jun 24, 2024 · 91 comments
Closed
Assignees

Comments

@emirefek
Copy link

emirefek commented Jun 24, 2024

Maintainer's note:

v0.12.5 has been published please update and give it a test first


What version of VS Code are you using?
v1.90.2

What version of Tailwind CSS IntelliSense are you using?
v0.12.0

What version of Tailwind CSS are you using?
v3.4.4

What package manager are you using?
npm

What operating system are you using?
Windows

Tailwind config

import defaultTheme from "tailwindcss/defaultTheme";
import forms from "@tailwindcss/forms";
import typography from "@tailwindcss/typography";

/** @type {import('tailwindcss').Config} */
export default {
  content: [
    "./resources/views/**/*.blade.php",
    "./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php",
    "./vendor/laravel/jetstream/**/*.blade.php",
    "./storage/framework/views/*.php",
  ],

  theme: {
    extend: {
      fontFamily: {
        sans: ["Figtree", ...defaultTheme.fontFamily.sans],
      },
    },
  },

  plugins: [forms, typography],
};

VS Code settings

previous version works so I don't really wanna spend time to remove unrelated stuff from it.

Describe your issue
After last vscode extension update, it stoped working.

@emirefek emirefek changed the title V v0.12.0 broke intellisense on windows for me Jun 24, 2024
@darklight9811
Copy link

Same for me, I noticed not every project stopped working, but every monorepo project has stopped working.

@darklight9811
Copy link

Just wasted 2 hours trying to figure this out...

@mpkr
Copy link

mpkr commented Jun 25, 2024

I have the same issue, it works in 0.10.5 but the latest one

@HyunJinNo
Copy link

I have the same issue. It doesn't work in 0.12.0 on my window 11.

@mrfrost1110
Copy link

I'm having the same issue with v0.12.0 on Windows. Rolling back to v0.10.5 worked for me.

@kodlens
Copy link

kodlens commented Jun 25, 2024

I experienced the same issue for the updated v0.12.0, at first, I thought it was a conflict from other extensions, Rolling back to v0.10.5 solved the problem. OS(windows 10) (VS Code version 1.90.2)

@FredTreg
Copy link

Same for me: v0.12.0 does not work (Windows 10 + Dev containers), VS Code 1.90.2

Version 0.10.5 works

@konalt
Copy link

konalt commented Jun 25, 2024

Me too: v0.12.0 does not work on network drives. VS Code 1.90.2. v0.10.5 works fine

@dav1ee
Copy link

dav1ee commented Jun 25, 2024

Same for me with 0.12.0, had to downgrade to 0.10.5 to get it working again

@Tubig-Repo
Copy link

Tubig-Repo commented Jun 25, 2024

downgrade it an older version it worked for me. wasted like 5 hours of time figuring this bug out

@ayrtonandino
Copy link

For me it broke the little preview that shows what CSS is applying, when you hover over the class.

classPreview

I didn't know how much I rely on that.

@kantuza
Copy link

kantuza commented Jun 25, 2024

vscode 1.88.* not working
vscode 1.90.2 not working

@joedave13
Copy link

Mine's also not working with version 0.12.0, downgrade to 0.10.5 solve the problem for now

@belicks1999
Copy link

for me also its not working

@ndozhh
Copy link

ndozhh commented Jun 25, 2024

I have the same problem. 0.10.5 intellisense is working but only in the folder that contains the tailwind.config.ts file. I have a monorepo where tailwind.config.ts is located in apps/web, but now using 0.10.5 the autocomplete and hover class translation only work for apps/web. Files in ui are taking the classes but neither autocomplete nor hover class translation are working.

content: [
    './app/**/*.{js,jsx,ts,tsx}',
    '../../packages/ui/**/*.{js,ts,jsx,tsx}',
    '../docs/stories/*.{ts,tsx,js,jsx}',
  ],

File in packages/ui
error

@thecrypticace thecrypticace self-assigned this Jun 25, 2024
@xt0rted
Copy link
Contributor

xt0rted commented Jun 25, 2024

Looking at the log output of v0.12.0 this seems like it's due to path normalization which should be fixed by #980.

@thecrypticace
Copy link
Contributor

I'm working on pushing out a release with that fix right now

@thecrypticace
Copy link
Contributor

v0.12.1 has been published please give it a test

@thecrypticace
Copy link
Contributor

Added a note to try the update in the original issue/comment at the top

@ndozhh
Copy link

ndozhh commented Jun 25, 2024

@thecrypticace 0.12.1 is working thank you, but do you have any advice to debug why autocomplete not working in other packages outside where tailwind.config.ts is defined?. I don't know when it stopped working but yesterday I saw it's not working anymore. I think a month ago it was working well, any ideas? Thank you

@xt0rted
Copy link
Contributor

xt0rted commented Jun 25, 2024

If you find you're still not getting IntelliSense on Windows with v0.12.1 double check that the folder path used when opening VSCode matches what's on disk. If those don't match then this extension, and many others probably, won't work correctly.

When I first ran into this issue I was opening my workspace from GitHub Desktop which had a path casing that didn't match what was on disk. GitHub Desktop had c:\dev\project but on disk it was c:\Dev\Project.

I ran into this a second time with my pinned workspace in the task bar. Right click on the VSCode icon and hovering over my pinned workspace showed casing that also didn't match what was on disk. Un-pin, re-open, re-pin the workspace and everything worked again.

@thecrypticace
Copy link
Contributor

thecrypticace commented Jun 25, 2024

@ndozhh I would've assumed it was a bug in v0.12.x that's causing it but given that you mentioned that it's also broken in v0.10.5 — maybe a VSCode update? I'm not sure. I would check what @xt0rted mentioned and see if you see anything different there.

Any chance you can provide a reproduction repo that I can look at? Intellisense issues are notoriously complicated (and sometimes impossible) to debug without them.

I'm going to look into this and see if I can figure out a workaround for the casing-difference behavior because it's rather unfortunate. Only problem is some filesystems are case-sensitive (kinda wish they all were tbh) and some are not so I can't just blindly lowercase everything.

@darklight9811
Copy link

0.12.1 fixed it for me

@thecrypticace
Copy link
Contributor

🙌 🙌 fantastic. I'll leave this issue open for another day and if more people report in that it's fixed I'll close it.

@ayrtonandino
Copy link

0.12.1 fixed it for me

same

@binaryartifex
Copy link

binaryartifex commented Jun 25, 2024

EDIT: alright so after some digging, i can confirm my settings still work for version 0.12.0. the most recent patch update to 0.12.1 stuffs it up. The key difference between the VSCode extension outputs between both versions is that they both attach watch processes to all the below patterns without issue, but only 0.12.0 recognizes the custom names root config and runs the follow-on initialization scripts...the below scripts are not run with the new 0.12.1

[tailwind-workspace-preset.ts] Initializing...
[tailwind-workspace-preset.ts] supported features: ["layer:base","separator:root","content-list","jit","css-at-config","relative-content-paths","transpiled-configs"]
[tailwind-workspace-preset.ts] Loaded tailwindcss v3.4.4: F:\[omitted]\node_modules\.pnpm\tailwindcss@3.4.4_ts-node@10.9.2_@swc+core@1.6.5_@swc+helpers@0.5.11__@types+node@20.14.8_typescript@5.5.2_\node_modules\tailwindcss
[tailwind-workspace-preset.ts] Loaded Tailwind CSS config file: f:/[omitted]/tailwind-workspace-preset.ts
[tailwind-workspace-preset.ts] Loaded postcss v8.4.38: F:\[omitted]\node_modules\.pnpm\postcss@8.4.38\node_modules\postcss
[tailwind-workspace-preset.ts] Building...

mines cactus still. nx monorepo, been working smoothly all year till this new version. i have a root workspace config file that all app configs inherit from. i have a common ui folder that inherits from the workspace tailwind config, and any files within the apps or libs namespaced below have their appropriate tailwind configs. Im running a windows OS.

vscode settings

  "tailwindCSS.experimental.configFile": {
    "tailwind-workspace-preset.ts": ["libs/common/ui/**"],
    "apps/app-1/app/tailwind.config.ts": ["apps/app-1/app/**", "libs/app-1/**"],
    "apps/app-2/app/tailwind.config.ts": ["apps/app-2/app/**", "libs/app-2/**"],
    "apps/app-3/tailwind.config.ts": ["apps/app-3/app/**", "libs/app-3/**"]
  },
  "tailwindCSS.classAttributes": ["class", "className", ".*Styles.*"],
  "tailwindCSS.experimental.classRegex": [
        ["([\"'`][^\"'`]*.*?[\"'`])", "[\"'`]([^\"'`]*).*?[\"'`]"]
  ],
  "tailwindCSS.files.exclude": [
    "**/.git/**",
    "**/dist/**",
    "**/node_modules/**",
    "**/.nx/**",
    "**/.husky/**",
    "**/pnpm-lock.yaml"
  ]

prettier

{
  "arrowParens": "always",
  "bracketSameLine": false,
  "bracketSpacing": true,
  "endOfLine": "auto",
  "printWidth": 100,
  "tabWidth": 2,
  "singleQuote": false,
  "trailingComma": "all",
  "plugins": ["prettier-plugin-tailwindcss"],
  "tailwindConfig": "tailwind-workspace-preset.ts",
  "tailwindFunctions": ["tv"]
}

@ndozhh
Copy link

ndozhh commented Jun 25, 2024

@ndozhh I would've assumed it was a bug in v0.12.x that's causing it but given that you mentioned that it's also broken in v0.10.5 — maybe a VSCode update? I'm not sure. I would check what @xt0rted mentioned and see if you see anything different there.

Any chance you can provide a reproduction repo that I can look at? Intellisense issues are notoriously complicated (and sometimes impossible) to debug without them.

I'm going to look into this and see if I can figure out a workaround for the casing-difference behavior because it's rather unfortunate. Only problem is some filesystems are case-sensitive (kinda wish they all were tbh) and some are not so I can't just blindly lowercase everything.

@thecrypticace It's working now. The solution was to add an empty tailwind.config.ts file and a postcss.config.js file to my packages/ui and autocomplete works well now. I don't know why it was working before without those. Btw I tried this after having created the reproduction you asked for and notice it was working there. Thanks for the help!

@kodlens
Copy link

kodlens commented Jun 26, 2024

v0.12.1 has been published please give it a test

It's working, Thanks

@JasonHassold
Copy link

@thecrypticace this is on v0.13.8, the output looks the same to me. I can see that there is a newer pre-release version v0.13.9 but I can't get it to switch to that one.

Locating server…
Booting server...
Setting up server…
Listening for messages…
Loading Tailwind CSS projects from the workspace settings.
[Global] Creating projects: [{"folder":"/Users/jasonhassold/Documents/GitHub/[project]","config":"/Users/jasonhassold/Documents/GitHub/[project]/apps/tailwind.config.js","selectors":[{"priority":0,"pattern":"/Users/jasonhassold/Documents/GitHub/[project]/**"}],"user":true,"tailwind":{"version":"3.4.4","features":["layer:base","separator:root","content-list","jit","css-at-config","relative-content-paths","transpiled-configs"],"isDefaultVersion":false}}]
[Global] Preparing projects...
[Global] Adding watch patterns: /Users/jasonhassold/Documents/GitHub/[project]/apps/tailwind.config.js, /Users/jasonhassold/Documents/GitHub/[project]/apps, /Users/jasonhassold/Documents/GitHub/[project]
[Global] Initializing projects...
[Global] Initialized 0 projects

@thecrypticace
Copy link
Contributor

I can see that there is a newer pre-release version v0.13.9 but I can't get it to switch to that one.

Maybe you need to restart vscode? It's working fine here. The only difference in the two is some additional logging.

Does your project folder have potential special characters in it? Like brackets, parents, curlies, spaces, etc?

@JasonHassold
Copy link

@thecrypticace yeah it has parentheses, is that an issue?

@thecrypticace
Copy link
Contributor

Probably yeah — I should be able to fix that though!

@JasonHassold
Copy link

@thecrypticace I figured out why I can't install the latest version, I'm using Cursor (vscode fork) and they might be slightly behind so maybe the latest version of the extension is set to use a versions of vscode that Cursor hasn't updated to yet.

I went back over to vscode and was able to get v0.13.9 installed. When I have the the parentheses in the folder name it doesn't work and when I removed the parentheses it does work.

@JasonHassold
Copy link

@thecrypticace I also just confirmed v0.13.8 is working on Cursor without the parentheses in the folder name

@thecrypticace
Copy link
Contributor

okay cool yeah. I bumped from micromatch to picomatch and I think parens are special there so that was something I missed during the upgrade. I'll see if I can take care of that today. 👍

@FAHIM-33
Copy link

FAHIM-33 commented Jul 2, 2024

@FAHIM-33 You're having problems on Windows and linux? Can you open a separate issue with details and logs (Command Palette > "Tailwind CSS: Show Output") please?

I have opened a new issue as you asked. Here's the link:
#1008

@thecrypticace
Copy link
Contributor

thecrypticace commented Jul 3, 2024

I've released v0.12.4 which addresses some issues with matching documents to a project. Please update and report back. Thanks!

@joshuabalentine-PCC
Copy link

@thecrypticace It still doesn't work, but it seems closer:

[Global] Initializing projects...
[Info  - 4:08:14 PM] [GLOBAL] Matching project to document {
  fsPath: 'C:\\Users\\JoshuaBalentine\\Source\\[project]\\[path]\\[file].vue',
  normalPath: '/c:/Users/JoshuaBalentine/Source/[project]/[path]/[file].vue'
}
[Global] Initialized 0 projects
...

@erquhart
Copy link

erquhart commented Jul 4, 2024

I'm also on Mac and 0.12 broke for me as well, rolled back to v0.10.

I have tried 0.12.4, it did not make any difference that I can see.

When loading, I see the following in output:

This repeated many times:

[Info  - 8:06:19 PM] [GLOBAL] Matching project to document {
  fsPath: '/Users/<redacted-base-path>/<redacted-owner>/<redacted-repo>/main/src/ui/<redacted-filename>.tsx',
  normalPath: '/Users/<redacted-base-path>/<redacted-owner>/<redacted-repo>/main/src/ui/<redacted-filename>.tsx'
}

Then this shows up in the middle - the remainder of the trace is all lines in the sucrase package:

[Error - 8:06:19 PM] Tailwind CSS: Unexpected token, expected "{" (14:8)
SyntaxError: Unexpected token, expected "{" (14:8)
    at unexpected (/Users/<redacted-base-path>/<redacted-owner>/<redacted-repo>/main/node_modules/sucrase/dist/parser/traverser/util.js:99:15)

Note that whatever error this is referencing, I'm not given a hint on where it's at in my source, assuming it's in my source. But it's also unlikely to be a valid parsing issue, as my linting all runs fine and my project doesn't have any errors.

Then the original thing I pasted about matching project document prints a bunch more times.

@KevinDenys
Copy link

Mac:

v0.12.4 not working
Switched to the pre-release also not working: output

@erquhart
Copy link

erquhart commented Jul 4, 2024

@thecrypticace updated to prerelease, still not working. It would be really great to have more verbose logging in the output, I'm convinced multiple issues are occurring but that's tough to verify without logs.

@thecrypticace
Copy link
Contributor

thecrypticace commented Jul 4, 2024

@erquhart Your issue is definitely separate — seems like maybe a syntax error in the config file or one of the required/imported files. The error is thrown by sucrase which we used in loadConfig at one point (I think we only use babel now in the latest Tailwind CSS release but can't remember w/o looking). I'm a little surprised that downgrading would fix that though.

Mind opening a separate issue with details about your config file?

@erquhart
Copy link

erquhart commented Jul 4, 2024

@thecrypticace I think it's been broken this whole time for my use case (react native + twrnc), just not critically. "Building..." was always the last thing printed - unless that's expected, something was always a bit off.

I can't put any more time into this, so don't have the necessary bits gathered to open a proper issue, so I'll just leave what I've found here in case it's useful for anyone, as it is indeed a project/setup issue that breaks with v0.12+.

[Error - 8:06:19 PM] Tailwind CSS: Unexpected token, expected "{" (14:8)
SyntaxError: Unexpected token, expected "{" (14:8)
    at unexpected (/Users/<redacted-base-path>/<redacted-owner>/<redacted-repo>/main/node_modules/sucrase/dist/parser/traverser/util.js:99:15)
  • It's still not absolutely clear that this error is what's breaking intellisense for my use case, but it seems very likely

I'm planning on riding with v0.10.5 until the wheels fall off. Pretty sure Tailwind v4 will change how all of this works anyway.

@thecrypticace
Copy link
Contributor

thecrypticace commented Jul 5, 2024

@erquhart Ah! Okay the flow bit helps here I think. I'll look into it. Intellisense shouldn't totally break in the face of an invalid config — but your customizations won't show up of course and custom content paths won't necessarily be considered.

@thecrypticace
Copy link
Contributor

@erquhart So I've reproduced this but in my testing it didn't work in v0.10.5 either. I might see if I can improve the status quo but the big problem here is that twrnc is not meant to be included in the tailwind config at all — only in your source files.

@thecrypticace
Copy link
Contributor

thecrypticace commented Jul 5, 2024

I've released v0.12.5 which should address a lot of issues around windows / linux / macOS with regards to symlinks, mapped drives of network shares, and mounts of virtual hard disks.

@joshuabalentine-PCC
Copy link

@thecrypticace Success! Thank you!

@anay-208
Copy link

anay-208 commented Jul 9, 2024

Thanks, It works perfect!

@thecrypticace
Copy link
Contributor

I'm going to close this issue as all problems should be addressed. If you're still encountering issues please open another issue — thanks!

@erquhart
Copy link

@thecrypticace ah, I was including the tailwind.ts file that imports twrnc in my Tailwind config content! I excluded it and everything works now, thanks for the hint here.

@elepner
Copy link

elepner commented Aug 26, 2024

There's a regression on my setup on Windows after updating 0.12.6 to 0.12.7. I get error in the Output No matching project for document. Everything works fine after downgrading to 0.12.6.

@scibioulian
Copy link

There's a regression on my setup on Windows after updating 0.12.6 to 0.12.7. I get error in the Output No matching project for document. Everything works fine after downgrading to 0.12.6.

Experiencing exactly the same (error and downgrade-solution).

@JeanLuisTrunmore
Copy link

Me too, I'm getting that error on my VS Code.

@JeanLuisTrunmore
Copy link

It is adding a / before the root of the project, I think there was a leftover from develop process

@TomRadford
Copy link

There's a regression on my setup on Windows after updating 0.12.6 to 0.12.7. I get error in the Output No matching project for document. Everything works fine after downgrading to 0.12.6.

Same issue here on MacOS:

What version of VS Code are you using?
v1.92.2

What version of Tailwind CSS IntelliSense are you using?
v0.12.7

What version of Tailwind CSS are you using?
v3.4.10

What package manager are you using?
yarn

What operating system are you using?
macOS 14.3

@luco
Copy link

luco commented Aug 27, 2024

Same here:
[Info - 11:34:16] [GLOBAL] No matching project for document

Rolling back to 0.10.5 solves for now.

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