Skip to content
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

Suggestions for Tailwind CSS v4 are not provided when using the Standalone CLI #1145

Closed
dlongz opened this issue Jan 27, 2025 · 26 comments · Fixed by #1157
Closed

Suggestions for Tailwind CSS v4 are not provided when using the Standalone CLI #1145

dlongz opened this issue Jan 27, 2025 · 26 comments · Fixed by #1157
Labels
bug Something isn't working

Comments

@dlongz
Copy link

dlongz commented Jan 27, 2025

What version of VS Code are you using?

Version: 1.96.4 (Universal)
Commit: cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
Date: 2025-01-16T00:16:19.038Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 23.6.0

What version of Tailwind CSS IntelliSense are you using?

0.14.1

What version of Tailwind CSS are you using?

"tailwindcss": "^4.0.0"

What package manager are you using?

npm

What operating system are you using?

macOS

Tailwind config

None as per Tailwind 4
index.css
@import "tailwindcss";

VS Code settings

{
	"workbench.colorTheme": "Bearded Theme feat. Will",
	"workbench.iconTheme": "a-file-icon-vscode",
	"terminal.integrated.defaultProfile.windows": "Git Bash",
	"[json]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"editor.suggestSelection": "first",
	"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
	"files.exclude": {
		"**/.classpath": true,
		"**/.project": true,
		"**/.settings": true,
		"**/.factorypath": true
	},
	"workbench.editorAssociations": {
		"*.pdf": "pdf.preview"
	},
	"redhat.telemetry.enabled": true,
	"bracket-pair-colorizer-2.depreciation-notice": false,
	"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -javaagent:\"c:\\Users\\MrLew\\.vscode\\extensions\\gabrielbb.vscode-lombok-1.0.1\\server\\lombok.jar\"",
	"javascript.updateImportsOnFileMove.enabled": "always",
	"[javascriptreact]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"[javascript]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"[css]": {
		"editor.defaultFormatter": "vscode.css-language-features"
	},
	"sonarlint.rules": {
		"javascript:S4138": {
			"level": "off"
		},
		"javascript:S125": {
			"level": "off"
		}
	},
	"kite.showWelcomeNotificationOnStartup": false,
	"editor.largeFileOptimizations": false,
	"vsicons.dontShowNewVersionMessage": true,
	"[python]": {
		"editor.defaultFormatter": "ms-python.python",
		"editor.formatOnType": true
	},
	"editor.guides.bracketPairs": "active",
	"[typescriptreact]": {
		"editor.defaultFormatter": "vscode.typescript-language-features"
	},
	"files.associations": {
		"*.css": "tailwindcss"
	},
	"editor.quickSuggestions": {
		"strings": "on"
	},
	"Notes.notesLocation": "/Users/mrlewis/Notes",
	"git.autofetch": true,
	"editor.accessibilitySupport": "off",
	"emmet.preferences": {},
	"emmet.includeLanguages": {
		"\"javascript\"": "\"javascriptreact\""
	},
	"[html]": {
		"editor.defaultFormatter": "vscode.html-language-features"
	},
	"liveServer.settings.useLocalIp": true,
	"liveServer.settings.fullReload": true,
	"[sql]": {
		"editor.defaultFormatter": "mtxr.sqltools"
	},
	"editor.acceptSuggestionOnEnter": "smart",
	"editor.snippetSuggestions": "top",
	"breadcrumbs.enabled": false,
	"editor.detectIndentation": false,
	"editor.formatOnSave": true,
	"prettier.tabWidth": 4,
	"prettier.useTabs": true,
	"material-icon-theme.folders.theme": "specific",
    "workbench.productIconTheme": "a-file-icon-vscode-product-icon-theme",
    "editor.fontLigatures": true,
    "editor.fontVariations": false,
    "editor.fontFamily": "Lilex Nerd Font, Menlo, Monaco, 'Courier New', monospace"
}

Reproduction URL

n/a

Describe your issue

Tailwindcss Intelisense still needs a tailwind.config.js file however Tailwind 4 doesn't recommend using one in favor of the '''@import "tailwindcss";''' in the CSS file. With current recommended configuration, IntelliSense doesn't work at all.

@octave
Copy link

octave commented Jan 27, 2025

Yes it would be nice to activate it without requiring the now optional tailwind.config.js.

@thecrypticace
Copy link
Contributor

Tailwindcss Intelisense still needs a tailwind.config.js file

It does not. In a bare bones project it'll activate just fine with v4 without a config file. If it's not activating that's a bug.

Mind opening your project and posting the output from "Tailwind CSS: Show Output"?

@thecrypticace thecrypticace added the question Further information is requested label Jan 27, 2025
@danwetherald
Copy link

I also am required to add an empty tailwind.config.js in order to get this to work within nvim.

@octave
Copy link

octave commented Jan 27, 2025

@thecrypticace Here it is, using in a [email protected] project with the gem [email protected] (I updated the paths for readability):

Locating server…
Checking if /app/assets/tailwind/application.tailwind.css may be Tailwind-related…
Booting server...
Setting up server…
Listening for messages…
Searching for Tailwind CSS projects in the workspace's folders.
{"tailwind":{"version":"3.4.4","features":["layer:base","separator:root","content-list","jit","css-at-config-as-project","relative-content-paths","transpiled-configs"],"isDefaultVersion":true},"path":"/public/assets/application.tailwind-ee41ae41.css"}
{"tailwind":{"version":"3.4.4","features":["layer:base","separator:root","content-list","jit","css-at-config-as-project","relative-content-paths","transpiled-configs"],"isDefaultVersion":true},"path":"/app/assets/tailwind/application.tailwind.css"}
[Global] Creating projects: []
[Global] Preparing projects...
[Global] Initializing projects...
[Global] Initialized 0 projects
[Info  - 10:41:19 AM] [GLOBAL] No matching project for document {
  fsPath: '/app/views/pos/index.html.erb',
  normalPath: '/app/views/pos/index.html.erb'
}

@thecrypticace
Copy link
Contributor

Oooooh okay. You're using the Standalone CLI with Rails and the bundled Tailwind CSS version in IntelliSense is still v3.4. I'll have to come up with a solution to bundle both and pick the right one when its not installed via npm.

As a short term workaround you can npm install tailwindcss@latest and it should work.

@thecrypticace thecrypticace added bug Something isn't working and removed question Further information is requested labels Jan 27, 2025
@thecrypticace thecrypticace changed the title bradlc.vscode-tailwindcss Version 0.14.1 with Tailwindcss 4.0 doesn't activate Suggestions for Tailwind CSS v4 are not provided when using the Standalone CLI Jan 27, 2025
@octave
Copy link

octave commented Jan 27, 2025

@thecrypticace got it! I have it posted here too for reference: rails/tailwindcss-rails#450 (comment)

@thecrypticace
Copy link
Contributor

@danwetherald @dlongz Are you both also using rails?

@cb911nr
Copy link

cb911nr commented Jan 27, 2025

Came looking for this, had the same problem..

Installed vite with react...
edited vite.config.js to include tailwind...

intellisense didn't work until I added the optional tailwind.config.js (and it's blank)

@thecrypticace
Copy link
Contributor

thecrypticace commented Jan 27, 2025

@cb911nr Did you create a CSS file that imports tailwindcss / edit the existing one?

If you did and it still didn't pick it up mind opening a separate issue with the steps you took?

@dlongz
Copy link
Author

dlongz commented Jan 28, 2025

Tailwindcss Intelisense still needs a tailwind.config.js file

It does not. In a bare bones project it'll activate just fine with v4 without a config file. If it's not activating that's a bug.

Mind opening your project and posting the output from "Tailwind CSS: Show Output"?

So i was able to get it to work by including a basic tailwind.config file. I didnt need to add any experimental flags or point it to the config file.

While trying to get the output from Tailwind CSS i deleted the tailwind.config file. But after deleting it the intellisense still work.

I'll creat a new project without the tailwind.config to replicate the bug and post the output from that project.

@dlongz
Copy link
Author

dlongz commented Jan 28, 2025

@danwetherald @dlongz Are you both also using rails?

No not rails. Just react19 via vite.

@cb911nr
Copy link

cb911nr commented Jan 28, 2025

Vite as well here.

@dlongz
Copy link
Author

dlongz commented Jan 28, 2025

Tailwindcss Intelisense still needs a tailwind.config.js file

It does not. In a bare bones project it'll activate just fine with v4 without a config file. If it's not activating that's a bug.

Mind opening your project and posting the output from "Tailwind CSS: Show Output"?

Here is the output form Tailwindcss IntelliSense

[Info - 9:43:29 PM] [GLOBAL] No matching project for document {
fsPath: '/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src/App.jsx',
normalPath: '/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src/App.jsx'
}

Steps Taken to create new project

  1. create new React javascript project via Vite
  2. update to React 19 (vite still ships with React 18)
  3. install Tailwindcss as per doc
  4. try tailwind intellisense. Unable to activate it. When trying to bring up the drop down selection of Tailwindcss Classes using 'option - spacebar' It only brings up recent words i've type. It doesn't bring up anything from the Tailwind Intelisense.

@thecrypticace
Copy link
Contributor

@dlongz Can you give me all of the output from when you do that. Not just the last message?

@dlongz
Copy link
Author

dlongz commented Jan 29, 2025

@dlongz Can you give me all of the output from when you do that. Not just the last message?

Well, Yes I can however now its working in the same project i created to reproduce the bug.

I didn't realized i should copy everything before. it had the same output back to back for some time just different timestamps. So i just copied the last one since I didn't see any difference. I also didn't scroll all the way to the beginning, it was really long.

Here is the output anyways but on this one it is working and it does not have the tailwind.config file.

Locating server…
Checking if /Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src/index.css may be Tailwind-related…
Booting server...
Setting up server…
Listening for messages…
Searching for Tailwind CSS projects in the workspace's folders.
{"tailwind":{"version":"4.0.0","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false},"path":"/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src/index.css"}
[Global] Creating projects: [{"folder":"/Users/mrlewis/React-Refresher/Github-tailwindcss-bug","config":"/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src/index.css","selectors":[{"pattern":"/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src/index.css","priority":0},{"pattern":"/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src/","priority":2},{"pattern":"/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/","priority":4},{"pattern":"/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/**","priority":5}],"user":false,"tailwind":{"version":"4.0.0","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}}]
[Global] Preparing projects...
[Global] Initializing projects...
[src/index.css] Initializing...
[Global] Adding watch patterns: /Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src/index.css, /Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src, /Users/mrlewis/React-Refresher/Github-tailwindcss-bug
[src/index.css] supported features: ["css-at-theme","layer:base","content-list"]
[src/index.css] Loaded tailwindcss v4.0.0: /Users/mrlewis/React-Refresher/Github-tailwindcss-bug/node_modules/tailwindcss
[src/index.css] Building...
[Global] Adding watch patterns: /Users/mrlewis/React-Refresher/Github-tailwindcss-bug/node_modules/tailwindcss/index.css
[Global] Initialized 1 projects
[src/index.css] File changed: /Users/mrlewis/React-Refresher/Github-tailwindcss-bug/package-lock.json
[src/index.css] Initializing...
[src/index.css] supported features: ["css-at-theme","layer:base","content-list"]
[src/index.css] Loaded tailwindcss v4.0.0: /Users/mrlewis/React-Refresher/Github-tailwindcss-bug/node_modules/tailwindcss
[src/index.css] Building...
Booting CSS server for Tailwind CSS language mode

@thecrypticace
Copy link
Contributor

Ah yeah if it's working I don't think the output is going to help me much. Need to see what's happening when it isn't. But, good to know it's working for you now 👍

@dlongz
Copy link
Author

dlongz commented Jan 29, 2025

@thecrypticace

So i created a new project github2-tailwindcss-bug
followed the same process i outlined before and its not working.

Here is the outpu from Tailwind Intelisense:

Locating server…
Booting server...
Setting up server…
Listening for messages…
Searching for Tailwind CSS projects in the workspace's folders.
hoist-at-import: The file '/Users/mrlewis/React-Refresher/Movie-React-app/src/index.css' contains @import rules after other at rules. This is invalid CSS and may cause problems with your build.
{"tailwind":{"version":"4.0.0","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false},"path":"/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src/index.css"}
{"tailwind":{"version":"4.0.0","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false},"path":"/Users/mrlewis/React-Refresher/Movie-React-app/src/index.css"}
{"tailwind":{"version":"4.0.0","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false},"path":"/Users/mrlewis/React-Refresher/todo-js-react-app/src/index.css"}
{"tailwind":{"version":"3.4.4","features":["layer:base","separator:root","content-list","jit","css-at-config-as-project","relative-content-paths","transpiled-configs"],"isDefaultVersion":true},"path":"/Users/mrlewis/React-Refresher/remix-react-app/tailwind.config.ts"}
{"tailwind":{"version":"3.4.4","features":["layer:base","separator:root","content-list","jit","css-at-config-as-project","relative-content-paths","transpiled-configs"],"isDefaultVersion":true},"path":"/Users/mrlewis/React-Refresher/remix-react-app/app/tailwind.css"}
{"tailwind":{"version":"3.4.17","features":["layer:base","separator:root","content-list","jit","css-at-config-as-project","relative-content-paths","transpiled-configs"],"isDefaultVersion":false},"path":"/Users/mrlewis/React-Refresher/next-react-proj-3rd/tailwind.config.mjs"}
{"tailwind":{"version":"3.4.17","features":["layer:base","separator:root","content-list","jit","css-at-config-as-project","relative-content-paths","transpiled-configs"],"isDefaultVersion":false},"path":"/Users/mrlewis/React-Refresher/next-react-proj-3rd/src/app/globals.css"}
{"tailwind":{"version":"3.4.17","features":["layer:base","separator:root","content-list","jit","css-at-config-as-project","relative-content-paths","transpiled-configs"],"isDefaultVersion":false},"path":"/Users/mrlewis/React-Refresher/next-react-app/tailwind.config.mjs"}
{"tailwind":{"version":"3.4.17","features":["layer:base","separator:root","content-list","jit","css-at-config-as-project","relative-content-paths","transpiled-configs"],"isDefaultVersion":false},"path":"/Users/mrlewis/React-Refresher/next-react-app/src/app/globals.css"}
[Global] Creating projects: [{"folder":"/Users/mrlewis/React-Refresher","config":"/Users/mrlewis/React-Refresher/next-react-app/tailwind.config.mjs","selectors":[{"pattern":"/Users/mrlewis/React-Refresher/next-react-app/tailwind.config.mjs","priority":0},{"pattern":"/Users/mrlewis/React-Refresher/next-react-app/**","priority":3}],"user":false,"tailwind":{"version":"3.4.17","features":["layer:base","separator:root","content-list","jit","css-at-config-as-project","relative-content-paths","transpiled-configs"],"isDefaultVersion":false}},{"folder":"/Users/mrlewis/React-Refresher","config":"/Users/mrlewis/React-Refresher/next-react-proj-3rd/tailwind.config.mjs","selectors":[{"pattern":"/Users/mrlewis/React-Refresher/next-react-proj-3rd/tailwind.config.mjs","priority":0},{"pattern":"/Users/mrlewis/React-Refresher/next-react-proj-3rd/**","priority":3}],"user":false,"tailwind":{"version":"3.4.17","features":["layer:base","separator:root","content-list","jit","css-at-config-as-project","relative-content-paths","transpiled-configs"],"isDefaultVersion":false}},{"folder":"/Users/mrlewis/React-Refresher","config":"/Users/mrlewis/React-Refresher/remix-react-app/tailwind.config.ts","selectors":[{"pattern":"/Users/mrlewis/React-Refresher/remix-react-app/tailwind.config.ts","priority":0},{"pattern":"/Users/mrlewis/React-Refresher/remix-react-app/**","priority":3}],"user":false,"tailwind":{"version":"3.4.4","features":["layer:base","separator:root","content-list","jit","css-at-config-as-project","relative-content-paths","transpiled-configs"],"isDefaultVersion":true}},{"folder":"/Users/mrlewis/React-Refresher","config":"/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src/index.css","selectors":[{"pattern":"/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src/index.css","priority":0},{"pattern":"/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/src/**","priority":2},{"pattern":"/Users/mrlewis/React-Refresher/Github-tailwindcss-bug/**","priority":4}],"user":false,"tailwind":{"version":"4.0.0","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}},{"folder":"/Users/mrlewis/React-Refresher","config":"/Users/mrlewis/React-Refresher/Movie-React-app/src/index.css","selectors":[{"pattern":"/Users/mrlewis/React-Refresher/Movie-React-app/src/index.css","priority":0},{"pattern":"/Users/mrlewis/React-Refresher/Movie-React-app/src/**","priority":2},{"pattern":"/Users/mrlewis/React-Refresher/Movie-React-app/**","priority":4}],"user":false,"tailwind":{"version":"4.0.0","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}},{"folder":"/Users/mrlewis/React-Refresher","config":"/Users/mrlewis/React-Refresher/todo-js-react-app/src/index.css","selectors":[{"pattern":"/Users/mrlewis/React-Refresher/todo-js-react-app/src/index.css","priority":0},{"pattern":"/Users/mrlewis/React-Refresher/todo-js-react-app/src/**","priority":2},{"pattern":"/Users/mrlewis/React-Refresher/todo-js-react-app/**","priority":4}],"user":false,"tailwind":{"version":"4.0.0","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}}]
[Global] Preparing projects...
[Global] Adding watch patterns: /Users/mrlewis/React-Refresher/next-react-app/tailwind.config.mjs, /Users/mrlewis/React-Refresher/next-react-app, /Users/mrlewis/React-Refresher
[Global] Adding watch patterns: /Users/mrlewis/React-Refresher/next-react-proj-3rd/tailwind.config.mjs, /Users/mrlewis/React-Refresher/next-react-proj-3rd
[Global] Adding watch patterns: /Users/mrlewis/React-Refresher/remix-react-app/tailwind.config.ts, /Users/mrlewis/React-Refresher/remix-react-app
[Global] Initializing projects...
[Global] Initialized 0 projects
[Error - 7:06:32 PM] Unhandled rejection Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/mrlewis/React-Refresher/next-react-app/tailwind.config.mjs not supported.
Instead change the require of /Users/mrlewis/React-Refresher/next-react-app/tailwind.config.mjs to a dynamic import() which is available in all CommonJS modules.
    at c._load (node:electron/js2c/node_init:2:16955)
    at OHe (/Users/mrlewis/.vscode/extensions/bradlc.vscode-tailwindcss-0.14.1/dist/tailwindServer.js:1779:7908)
    at Object.v [as onFileEvents] (/Users/mrlewis/.vscode/extensions/bradlc.vscode-tailwindcss-0.14.1/dist/tailwindServer.js:1777:11122)
    at b (/Users/mrlewis/.vscode/extensions/bradlc.vscode-tailwindcss-0.14.1/dist/tailwindServer.js:1781:12786)
    at async /Users/mrlewis/.vscode/extensions/bradlc.vscode-tailwindcss-0.14.1/dist/tailwindServer.js:1781:13119 {
  code: 'ERR_REQUIRE_ESM'
}
[Info  - 7:07:33 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:33 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:33 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:35 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:37 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:39 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:40 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:40 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:41 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:41 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:43 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:44 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:44 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:47 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:49 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:49 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:50 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:07:54 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css'
}
Booting CSS server for Tailwind CSS language mode
[Info  - 7:07:54 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css'
}
[Info  - 7:07:54 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css'
}
[Info  - 7:07:56 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css'
}
[Info  - 7:07:58 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css'
}
[Info  - 7:07:58 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css'
}
[Info  - 7:07:59 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css'
}
[Info  - 7:07:59 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css'
}
[Info  - 7:07:59 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css'
}
[Info  - 7:08:00 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css'
}
[Info  - 7:08:01 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css'
}
[Info  - 7:08:02 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/index.css'
}
[Info  - 7:08:07 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/vite.config.js'
}
[Info  - 7:08:08 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/package.json',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/package.json'
}
[Info  - 7:08:12 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:12 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:12 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:22 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:23 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:24 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:25 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:28 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:29 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:30 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:34 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:35 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:36 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:38 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:38 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:39 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:40 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:43 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:43 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:44 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:46 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:47 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:49 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:50 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:50 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:55 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:56 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:08:57 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:09:11 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:09:16 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:09:17 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:09:17 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:09:19 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}
[Info  - 7:09:24 PM] [GLOBAL] No matching project for document {
  fsPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx',
  normalPath: '/Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/src/App.jsx'
}

@dlongz
Copy link
Author

dlongz commented Jan 29, 2025

Ah yeah if it's working I don't think the output is going to help me much. Need to see what's happening when it isn't. But, good to know it's working for you now 👍

Well I spoke too soon. lol. Not working. Interested to see what made the known non-working project to suddenly work.
The new project did not work. Maybe tomorrow same time it will be working? Just looking for a pattern.

@thecrypticace
Copy link
Contributor

Ah so it looks like you opened /Users/mrlewis/React-Refresher instead of /Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/ in VSCode and it's picking up a large number of Tailwind CSS installations from all the folders below it. In theory this should be fine but might be part of the issue.

@dlongz
Copy link
Author

dlongz commented Jan 29, 2025

Ah so it looks like you opened /Users/mrlewis/React-Refresher instead of /Users/mrlewis/React-Refresher/Github2-tailwindcss-bug/ in VSCode and it's picking up a large number of Tailwind CSS installations from all the folders below it. In theory this should be fine but might be part of the issue.

Ok i'll make a new project outside of the React-Refresher directory and let you know how it turns out.

@ericmesmo
Copy link

Im running into the same issue. The intellisense only works when im in the package/ui folder files, but as soon as i try to import package/ui from any other app inside of my monorepo, the intellisense stops working again. :/

@thecrypticace
Copy link
Contributor

Im running into the same issue. The intellisense only works when im in the package/ui folder files, but as soon as i try to import package/ui from any other app inside of my monorepo, the intellisense stops working again. :/

@ericmesmo Could you open a separate issue with a reproduction?

@dlongz
Copy link
Author

dlongz commented Jan 30, 2025

@thecrypticace
Ok this test was a success. It work in a diff directory outside the React-refresher one i was using.
No tailwindcss.config file nessessary.

I'll still post the output just in case you can spot a pattern for why it wasn't activating before.

Locating server…
Checking if /Users/mrlewis/Bug-Replication/src/index.css may be Tailwind-related…
Checking if /Users/mrlewis/Bug-Replication/src/App.css may be Tailwind-related…
Checking if /Users/mrlewis/Bug-Replication/src/index.css may be Tailwind-related…
Checking if /Users/mrlewis/Bug-Replication/src/App.css may be Tailwind-related…
Booting CSS server for Tailwind CSS language mode
Checking if /Users/mrlewis/Bug-Replication/src/index.css may be Tailwind-related…
Checking if /Users/mrlewis/Bug-Replication/src/App.css may be Tailwind-related…
Booting server...
Setting up server…
Listening for messages…
Searching for Tailwind CSS projects in the workspace's folders.
{"tailwind":{"version":"4.0.1","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false},"path":"/Users/mrlewis/Bug-Replication/src/index.css"}
[Global] Creating projects: [{"folder":"/Users/mrlewis/Bug-Replication","config":"/Users/mrlewis/Bug-Replication/src/index.css","selectors":[{"pattern":"/Users/mrlewis/Bug-Replication/src/index.css","priority":0},{"pattern":"/Users/mrlewis/Bug-Replication/src/","priority":2},{"pattern":"/Users/mrlewis/Bug-Replication/","priority":4},{"pattern":"/Users/mrlewis/Bug-Replication/**","priority":5}],"user":false,"tailwind":{"version":"4.0.1","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}}]
[Global] Preparing projects...
[Global] Initializing projects...
[src/index.css] Initializing...
[Global] Adding watch patterns: /Users/mrlewis/Bug-Replication/src/index.css, /Users/mrlewis/Bug-Replication/src, /Users/mrlewis/Bug-Replication
[src/index.css] supported features: ["css-at-theme","layer:base","content-list"]
[src/index.css] Loaded tailwindcss v4.0.1: /Users/mrlewis/Bug-Replication/node_modules/tailwindcss
[src/index.css] Building...
[Global] Adding watch patterns: /Users/mrlewis/Bug-Replication/node_modules/tailwindcss/index.css
[Global] Initialized 1 projects
---- RELOADING DESIGN SYSTEM ----
---- /Users/mrlewis/Bug-Replication/src/index.css ----
---- RELOADED IN 265.61ms ----

@catgoose
Copy link

catgoose commented Feb 1, 2025

I also am required to add an empty tailwind.config.js in order to get this to work within nvim.

Same here. I am doing this in a go project with the tailwind cli so doing npm install tailwindcss@latest is not an option for me.

Maybe we can pass in configuration to tailwind LSP for a filepattern to determine if tailwind LSP should be active instead of defaulting to tailwind.config.{js|ts}

@thecrypticace
Copy link
Contributor

I merged a fix for the standalone CLI stuff in #1157. Gonna push out a release (probably tomorrow at this point) that enables IntelliSense for v4 even when not using npm. The drawback is that right now things like import plugin from 'tailwindcss/plugin' won't work in configs and plugins. That's proving to be a bit more challenging to get working with native ESM support but outside of that, everything else should work as expected.

@catgoose
Copy link

catgoose commented Feb 6, 2025

I merged a fix for the standalone CLI stuff in #1157. Gonna push out a release (probably tomorrow at this point) that enables IntelliSense for v4 even when not using npm. The drawback is that right now things like import plugin from 'tailwindcss/plugin' won't work in configs and plugins. That's proving to be a bit more challenging to get working with native ESM support but outside of that, everything else should work as expected.

What if I am only using the tailwind cli? Do I still need to have a tailwind.conf.js in project root for the LSP to be active?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants