merrickluo / lsp-tailwindcss

the lsp-mode client for tailwindcss
GNU General Public License v3.0
180 stars 21 forks source link

LSP server running but can't get it to work #47

Closed htetyan closed 1 year ago

htetyan commented 1 year ago

make sure to read the troubleshooting guide first.

Been trying to figure out how to get this going without any success.

I've read through the other activation issues and all the previous closed issues on this. Haven't seem to got it running here. Using Doom Emacs.

The lsp server is installed: lsp-describe-session shows that the tailwindcss server is running on the project folder but I'm not getting any auto-completion inside my html file in web-mode.

I've tested this file and folder with VS Code and there is no problem with the tailwind setup it on that editor.

Also added the use-package config to my config.el that I saw in other closed issues.

(use-package! lsp-tailwindcss
  :init
  (setq lsp-tailwindcss-add-on-mode t)
  :config
  (setq lsp-tailwindcss-major-modes '(svelte-mode html-mode sgml-mode mhtml-mode web-mode css-mode)))

Edit: I also get a warning when it loads Warning (lsp-mode): Unknown notification: @/tailwindCSS/error

Edit 2: Replicated the same error and issue on another device running the same config.

Here is a screenshot:

Screen Shot 2022-10-22 at 21 57 24
davedailem commented 1 year ago

Just ran into the same thing, just make sure your workspace is configured to use tailwind.

htetyan commented 1 year ago

Just ran into the same thing, just make sure your workspace is configured to use tailwind.

Thank you for replying, been trying to solve and hitting a wall.

@year39 Did you get the error buffer warning? Warning (lsp-mode): Unknown notification: @/tailwindCSS/error

Screen Shot 2022-10-26 at 23 13 26

This is my configuration:

Screen Shot 2022-10-26 at 23 04 11

The config is working in VS Code:

Screen Shot 2022-10-26 at 23 07 46

Please let me know if there something wrong with this tailwindcss config.

htetyan commented 1 year ago

Update and closing issue

TLDR Was fixed by rolling back to tailwindcss 3.1.8 npm package.

Original issue: Server is running but does not activate auto-compeletion. A popup buffer shows the following message: Warning (lsp-mode): Unknown notification: @/tailwindCSS/error

De-bugging with LSP Log

Checked the lsp-log buffer and output:

Command "node /Users/../.emacs.d/.local/etc/lsp/tailwindcss/extension/dist/tailwindServer.js --stdio" is present on the path.
...
...
Creating watchers for following 3 folders:
  /Users/../Projects/tailwind-2
  /Users/../Projects/tailwind-2/.log
  /Users/../Projects/tailwind-2/src
Found Tailwind CSS config file: /Users/../Projects/tailwind-2/tailwind.config.js
Loaded postcss v8.4.18: /Users/../Projects/tailwind-2/node_modules/postcss
Loaded tailwindcss v3.2.1: /Users/../Projects/tailwind-2/node_modules/tailwindcss

**Tailwind CSS: Cannot read properties of undefined (reading 'modifier')
TypeError: Cannot read properties of undefined (reading 'modifier')
    at api.addVariant (/Users/../Projects/tailwind-2/node_modules/tailwindcss/lib/lib/setupContextUtils.js:578:40)
    at /Users/../Projects/tailwind-2/node_modules/tailwindcss/lib/lib/setupContextUtils.js:538:38
    at /Users/../.emacs.d/.local/etc/lsp/tailwindcss/extension/dist/tailwindServer.js:695:4431
    at Array.forEach (<anonymous>)
    at Jwe (/Users/../.emacs.d/.local/etc/lsp/tailwindcss/extension/dist/tailwindServer.js:695:3916)
    at /Users/../.emacs.d/.local/etc/lsp/tailwindcss/extension/dist/tailwindServer.js:695:286
    at Generator.next (<anonymous>)
    at i (/Users/../.emacs.d/.local/etc/lsp/tailwindcss/extension/dist/tailwindServer.js:1:1059)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)**

Searched for issues relating to Tailwind CSS: Cannot read properties of undefined (reading 'modifier')

Found the following issues on github: https://github.com/tailwindlabs/tailwindcss-intellisense/issues/641 https://github.com/tailwindlabs/tailwindcss/discussions/9641

Fix: Rolling back the npm package of tailwindcss to 3.1.8

Screen Shot 2022-10-26 at 23 39 46