Skip to content

V4 intellisense not working in a monorepo v0.12.9 and after #1054

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
sibbng opened this issue Sep 21, 2024 · 8 comments
Closed

V4 intellisense not working in a monorepo v0.12.9 and after #1054

sibbng opened this issue Sep 21, 2024 · 8 comments
Assignees
Labels
question Further information is requested

Comments

@sibbng
Copy link

sibbng commented Sep 21, 2024

What version of VS Code are you using?

v.1.93.1

What version of Tailwind CSS IntelliSense are you using?

0.12.9
Tried 0.12.10 and pre-release too

What version of Tailwind CSS are you using?

4.0.0-alpha.24

What package manager are you using?

pnpm

What operating system are you using?

Windows

Tailwind config

/** @type {import('tailwindcss').Config} */
export default {
  content: ["./client/src/**/*.{js,jsx,ts,tsx}"],
  theme: {
    extend: {},
  },
  plugins: [],
};

VS Code settings

  "tailwindCSS.experimental.classRegex": [
    ["clsx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
  ],

Reproduction URL

I thought the issue is obvious, if it's not I would happily provide a repro.

Describe your issue

Hi, I'm using v4 in a monorepo and I have 2 issues:

1- Intellisense not working v0.12.9 and after (including pre-release)
2- v0.12.8 (working version) only working if I have @config "path/to/tailwind.conf.ts" in my css file. I thought config file is not mandatory in v4.

Workaround

@sibbng sibbng changed the title V4 intellisense not working v0.12.9 and after in Windows V4 intellisense not working in a monorepo v0.12.9 and after Sep 21, 2024
@philipp-spiess
Copy link
Member

Hey @sibbng! Do you mind checking if the logs has any information on this? You can access it via View > Output and then picking the "Tailwind CSS IntelliSense" extension in the dropdown of the output module.

@sibbng
Copy link
Author

sibbng commented Sep 23, 2024

Prior to creating the issue I checked output but couldn't see an error. I checked again, and apparently v0.12.9 has significantly longer output.

v0.12.9 (not working)

Locating server…
Booting server...
Setting up server…
Listening for messages…
Searching for Tailwind CSS projects in the workspace's folders.
{"tailwind":{"version":"4.0.0-alpha.24","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}}
{"tailwind":{"version":"4.0.0-alpha.24","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}}
{"tailwind":{"version":"4.0.0-alpha.24","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}}
[Global] Creating projects: [{"folder":"C:\\Users\\user\\dev\\workup","config":"C:/Users/user/dev/workup/apps/web/client/src/main.css","selectors":[{"pattern":"C:/Users/user/dev/workup/apps/web/client/src/main.css","priority":0},{"pattern":"C:/Users/user/dev/workup/apps/web/client/src/**","priority":2},{"pattern":"C:/Users/user/dev/workup/apps/web/**","priority":4}],"user":false,"tailwind":{"version":"4.0.0-alpha.24","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}},{"folder":"C:\\Users\\user\\dev\\workup","config":"C:/Users/user/dev/workup/apps/web/client/src/themes.css","selectors":[{"pattern":"C:/Users/user/dev/workup/apps/web/client/src/themes.css","priority":0},{"pattern":"C:/Users/user/dev/workup/apps/web/client/src/**","priority":2},{"pattern":"C:/Users/user/dev/workup/apps/web/**","priority":4}],"user":false,"tailwind":{"version":"4.0.0-alpha.24","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}}]
[Global] Preparing projects...
[Global] Initializing projects...
[apps\web\client\src\main.css] Initializing...
[Global] Adding watch patterns: C:/Users/user/dev/workup/apps/web/client/src/main.css, C:/Users/user/dev/workup/apps/web/client/src, C:/Users/user/dev/workup/apps/web/client, C:/Users/user/dev/workup/apps/web, C:/Users/user/dev/workup/apps, C:/Users/user/dev/workup, C:/Users/user/dev, C:/Users/user, C:/Users, C:/
[apps\web\client\src\main.css] supported features: ["css-at-theme","layer:base","content-list"]
[apps\web\client\src\main.css] Loaded tailwindcss v4.0.0-alpha.24: C:\Users\user\dev\workup\node_modules\.pnpm\tailwindcss@4.0.0-alpha.24\node_modules\tailwindcss
[apps\web\client\src\main.css] Building...
[apps\web\client\src\main.css] Initializing...
[apps\web\client\src\main.css] supported features: ["css-at-theme","layer:base","content-list"]
[apps\web\client\src\main.css] Loaded tailwindcss v4.0.0-alpha.24: C:\Users\user\dev\workup\node_modules\.pnpm\tailwindcss@4.0.0-alpha.24\node_modules\tailwindcss
[apps\web\client\src\main.css] Building...
[apps\web\client\src\main.css] Initializing...
[apps\web\client\src\main.css] supported features: ["css-at-theme","layer:base","content-list"]
[apps\web\client\src\main.css] Loaded tailwindcss v4.0.0-alpha.24: C:\Users\user\dev\workup\node_modules\.pnpm\tailwindcss@4.0.0-alpha.24\node_modules\tailwindcss
[apps\web\client\src\main.css] Building...
[apps\web\client\src\main.css] Initializing...
[apps\web\client\src\main.css] supported features: ["css-at-theme","layer:base","content-list"]
[apps\web\client\src\main.css] Loaded tailwindcss v4.0.0-alpha.24: C:\Users\user\dev\workup\node_modules\.pnpm\tailwindcss@4.0.0-alpha.24\node_modules\tailwindcss
[apps\web\client\src\main.css] Building...
[Global] Initialized 4 projects

v0.12.8 (working)

Locating server…
Booting server...
Setting up server…
Listening for messages…
Searching for Tailwind CSS projects in the workspace's folders.
{"tailwind":{"version":"4.0.0-alpha.24","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}}
{"tailwind":{"version":"4.0.0-alpha.24","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}}
[Global] Creating projects: [{"folder":"C:\\Users\\user\\dev\\workup","config":"C:/Users/user/dev/workup/apps/web/client/src/themes.css","selectors":[{"pattern":"C:/Users/user/dev/workup/apps/web/client/src/themes.css","priority":0},{"pattern":"C:/Users/user/dev/workup/apps/web/client/src/**","priority":2},{"pattern":"C:/Users/user/dev/workup/apps/web/**","priority":4},{"pattern":"C:/Users/user/dev/workup/**","priority":5}],"user":false,"tailwind":{"version":"4.0.0-alpha.24","features":["css-at-theme","layer:base","content-list"],"isDefaultVersion":false}}]
[Global] Preparing projects...
[Global] Initializing projects...
[apps\web\client\src\themes.css] Initializing...
[Global] Adding watch patterns: C:/Users/user/dev/workup/apps/web/client/src/themes.css, C:/Users/user/dev/workup/apps/web/client/src, C:/Users/user/dev/workup/apps/web/client, C:/Users/user/dev/workup/apps/web, C:/Users/user/dev/workup/apps, C:/Users/user/dev/workup, C:/Users/user/dev, C:/Users/user, C:/Users, C:/
[apps\web\client\src\themes.css] supported features: ["css-at-theme","layer:base","content-list"]
[apps\web\client\src\themes.css] Loaded tailwindcss v4.0.0-alpha.24: C:\Users\user\dev\workup\node_modules\.pnpm\tailwindcss@4.0.0-alpha.24\node_modules\tailwindcss
[apps\web\client\src\themes.css] Building...
[Global] Initialized 1 projects

@sibbng
Copy link
Author

sibbng commented Sep 23, 2024

After doing git bisect locally I found that the issue first appear on #1044

After blindy restoring some of the changes, I found that after adding the following removed continue statement back fixes the issue:

https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1044/files#diff-24285a462ea95066a768f6f8b12ed8695a3cac1de01b0e1c1a1baa6f89b19c24L330

/cc @thecrypticace

@thecrypticace thecrypticace self-assigned this Sep 23, 2024
@brandongit2
Copy link

Yep, I can confirm this same issue is affecting us too. This feels like a pretty significant bug. This being outside the main Tailwind repo, it would be great to confirm that the Tailwind team has eyes on this!

@ffriedl89
Copy link

ffriedl89 commented Jan 15, 2025

I've stumbled across this issue as well and after debugging the extension i settled on a solution that works for us.
Intellisense stopped working whenever I tried to use v4 with a tailwind.config file instead of the new css config approach.
Pointing the config to the index.css solved the issue for us.

 "tailwindCSS.experimental.configFile": {
    "apps/product/app/index.css": ["apps/product/**", "libs/components/**"],
    "apps/www/tailwind.config.ts": "apps/www/**"
  },

For reference this is a monorepo where the www app still uses tailwind 3.x and the product already uses tailwind 4
Hope that helps :)

@thecrypticace
Copy link
Contributor

@sibbng Is this still a problem for you on the latest version of the extension?

@thecrypticace thecrypticace added the question Further information is requested label Feb 12, 2025
@sibbng
Copy link
Author

sibbng commented Feb 12, 2025

@thecrypticace It seems working as expected. For reference in my monorepo v4 was only Tailwind version used.

@thecrypticace
Copy link
Contributor

Ah excellent! Gonna close this one then 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants