theron-wang / VS2022-Editor-Support-for-Tailwind-CSS

Unofficial VS2022 Tailwind CSS extension for IntelliSense, linting, sorting, and more to enhance the development experience in Visual Studio 2022.
https://marketplace.visualstudio.com/items?itemName=TheronWang.TailwindCSSIntellisense
MIT License
95 stars 6 forks source link

Adding typography plugin breaks intellisense #87

Open skttl opened 5 days ago

skttl commented 5 days ago

When I add the official typography plugin to my config, I suddenly don't get Intellisense on my extended theme values.

As an example:

Here I have a quite basic config file, with one extended color. Intellisense works as expected: image

If I then add the typography plugin (and another color), (and close and reopen the cshtml file), I don't get intellisense for the new color.

image

As soon as I remove the plugin (and close and reopen the cshtml), intellisense works as expected image

I've also tried adding a custom plugin as per the tailwind docs, and that seems to work as expected image

theron-wang commented 1 day ago

@skttl Sorry, I wasn't able to reproduce this bug; is there an error being logged in the Extensions output pane by any chance? Thanks.

skttl commented 4 hours ago

Thanks for getting back.

I get this message:

System.InvalidOperationException: Error occurred while parsing configuration file: node:internal/modules/cjs/loader:1145
  const err = new Error(message);
              ^
Error: Cannot find module 'tailwindcss/defaultTheme'
Require stack:
- c:\users\skttl\appdata\local\microsoft\visualstudio\17.0_c7615a97\extensions\el0qbr2n.erb\Resources\parser.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at Module.require (c:\users\skttl\appdata\local\microsoft\visualstudio\17.0_c7615a97\extensions\el0qbr2n.erb\Resources\parser.js:37:36)
    at require (node:internal/modules/helpers:179:18)
    at theme (c:\users\skttl\appdata\local\microsoft\visualstudio\17.0_c7615a97\extensions\el0qbr2n.erb\Resources\parser.js:145:34)
    at C:\Workspaces\OrifarmBaseline\OrifarmBaseline\Presentation\Website\node_modules\@tailwindcss\typography\src\index.js:74:23
    at handler (c:\users\skttl\appdata\local\microsoft\visualstudio\17.0_c7615a97\extensions\el0qbr2n.erb\Resources\parser.js:16:64)
    at c:\users\skttl\appdata\local\microsoft\visualstudio\17.0_c7615a97\extensions\el0qbr2n.erb\Resources\parser.js:181:25
    at Array.forEach (<anonymous>) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'c:\\users\\skttl\\appdata\\local\\microsoft\\visualstudio\\17.0_c7615a97\\extensions\\el0qbr2n.erb\\Resources\\parser.js'
  ]
}
Node.js v20.15.0
   at TailwindCSSIntellisense.Configuration.ConfigFileParser.<GetConfigJsonNodeAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at TailwindCSSIntellisense.Configuration.ConfigFileParser.<GetConfigurationAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at TailwindCSSIntellisense.Configuration.CompletionConfiguration.<ReloadCustomAttributesAsync>d__47.MoveNext()

Seems like it has to do with getting values from the default theme