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

VSCode Hangs indefinitely while Formatting on save since version 0.9.8 #755

Closed
glekner opened this issue Apr 3, 2023 · 52 comments
Closed
Assignees

Comments

@glekner
Copy link

glekner commented Apr 3, 2023

What version of Tailwind CSS IntelliSense are you using?

v0.9.8+

What version of Tailwind CSS are you using?

v3.2.7

What package manager are you using?

yarn

What operating system are you using?

macOS

Tailwind config

/* eslint-disable unicorn/prefer-module */

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ['src/**/!(@generated)/*.{ts,tsx}', './index.html'],
  darkMode: ['class', `.bp3-dark`],
  theme: {
    extend: {
      colors: {
        primary: '#0254ec',
        foreground: '#ffffff',
        tint1: '#F9F9FB',
        tint2: '#F5F6F7',

        text: {
          default: '#222',
          muted: '#737376',
          disabled: '#A6B1BB',
        },

        border: {
          default: '#E4E7EB',
          muted: '#F5F6F7',
        },

        // dark theme colors
        dark: {
          foreground: '#0D1116',
          tint1: '#161B22',
          tint2: '#1c232b',

          text: {
            default: '#234361',
            muted: '#8C949E',
            disabled: '#535a63',
          },

          border: {
            default: '#30363D',
            muted: '#E4E7EB',
          },
        },
      },
    },
  },
  plugins: [
    require('@tailwindcss/typography'),
    require('@tailwindcss/forms')({
      // disable base styles since it conflicts with blueprint css
      strategy: 'class',
    }),
  ],
  corePlugins: {
    // disable preflight since we use blueprint css normalization
    preflight: false,
  },
};

VS Code settings

{
  "editor.fontFamily": "Jetbrains Mono, Copyright Klim Type Foundry, SF Mono,IBM Plex Mono, Consolas",
  "editor.inlineSuggest.enabled": true,
  "terminal.integrated.defaultProfile.osx": "fish",
  "terminal.integrated.defaultProfile.linux": "zsh",
  "terminal.integrated.fontSize": 12,
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "git.autofetch": true,
  "git.confirmSync": false,
  "[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "typescript.updateImportsOnFileMove.enabled": "always",
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "redhat.telemetry.enabled": false,
  "editor.fontSize": 13,
  "javascript.updateImportsOnFileMove.enabled": "always",
  "[scss]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "github.copilot.enable": {
    "*": true,
    "yaml": false,
    "plaintext": true,
    "markdown": false,
    "json": true
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "security.workspace.trust.untrustedFiles": "open",
  "editor.formatOnSave": true,
  "workbench.colorCustomizations": {
    "[Horizon Extended]": {
      "editor.background": "#1e252d",
      "tab.border": "#474a62a1",
      "panel.border": "#474a62a1",
      "sideBar.border": "#474a62a1",
      "titleBar.border": "#474a62a1",
      "panel.dropBorder": "#474a62a1",
      "activityBar.border": "#474a62a1",
      "menu.border": "#474a62a1",
      "terminal.border": "#474a62a1",
      "tab.activeBorder": "#98a4fc",
      "editorGroup.border": "#474a62a1",
      "activityBar.inactiveForeground": "#9f9cb2",
      "activityBar.foreground": "#d19fff",
      "scrollbarSlider.background": "#d6dbff3e"
    }
  },
  "editor.tokenColorCustomizations": {
    "[Night Wolf (dark blue)]": {}
  },
  "editor.minimap.enabled": false,
  "explorer.sortOrder": "type",
  "editor.guides.bracketPairs": "active",
  "[yaml]": {
    "editor.defaultFormatter": "redhat.vscode-yaml"
  },
  "terminal.integrated.enablePersistentSessions": false,
  "editor.cursorSmoothCaretAnimation": "on",
  "workbench.list.smoothScrolling": true,
  "git.mergeEditor": true,
  "editor.codeLensFontFamily": "Copyright Klim Type Foundry",
  "editor.inlayHints.fontFamily": "Copyright Klim Type Foundry",
  "helium-icon-theme.folders.color": "#90a4ae",
  "helium-icon-theme.folders.theme": "specific",
  "terminal.integrated.env.osx": {
    "FIG_NEW_SESSION": "1"
  },
  "editor.accessibilitySupport": "off",
  "debug.console.fontFamily": "Copyright Klim Type Foundry",
  "telemetry.telemetryLevel": "off",
  "oneDarkPro.italic": false,
  "breadcrumbs.symbolPath": "off",
  "window.commandCenter": true,
  "workbench.editor.autoLockGroups": {
    "jsProfileVisualizer.cpuprofile.table": true
  },
  "editor.fontLigatures": false,
  "editor.gotoLocation.multipleDefinitions": "goto",
  "editor.gotoLocation.multipleTypeDefinitions": "goto",
  "editor.foldingMaximumRegions": 10000,
  "turboConsoleLog.wrapLogMessage": false,
  "turboConsoleLog.logMessagePrefix": "",
  "turboConsoleLog.includeFileNameAndLineNum": false,
  "editor.stickyScroll.enabled": true,
  "mergeEditor.diffAlgorithm": "experimental",
  "yaml.customTags": [
    "!And",
    "!And sequence",
    "!If",
    "!If sequence",
    "!Not",
    "!Not sequence",
    "!Equals",
    "!Equals sequence",
    "!Or",
    "!Or sequence",
    "!FindInMap",
    "!FindInMap sequence",
    "!Base64",
    "!Join",
    "!Join sequence",
    "!Cidr",
    "!Ref",
    "!Sub",
    "!Sub sequence",
    "!GetAtt",
    "!GetAZs",
    "!ImportValue",
    "!ImportValue sequence",
    "!Select",
    "!Select sequence",
    "!Split",
    "!Split sequence"
  ],
  "extensions.experimental.useUtilityProcess": true,
  "editor.smoothScrolling": true,
  "githubPullRequests.notifications": "pullRequests",
  "remote.SSH.remotePlatform": {
    "sandbox.1vs96w.csb": "linux",
    "wiz-sec.wiz.develop.csb": "linux"
  },
  "eslint.alwaysShowStatus": true,
  "debug.javascript.autoAttachFilter": "disabled",
  "svelte.enable-ts-plugin": true,
  "svelte.plugin.svelte.note-new-transformation": false,
  "totalTypeScript.hideAllTips": false,
  "totalTypeScript.hideBasicTips": true,
  "totalTypeScript.hiddenTips": [
    "passing-generics-to-types",
    "non-null-expression",
    "keyof",
    "typeof",
    "record-utility-type",
    "partial-utility-type",
    "nonnullable-utility-type",
    "omit-utility-type",
    "returntype-utility-type",
    "generic-slots-in-functions"
  ],
  "githubPullRequests.pullBranch": "never",
  "settingsSync.ignoredSettings": ["terminal.integrated.fontFamily"],
  "terminal.integrated.fontFamily": "Jetbrains Mono,SF Mono, Consolas, Copyright Klim Type Foundry",
  "terminal.integrated.persistentSessionReviveProcess": "never",
  "workbench.iconTheme": "bearded-icons",
  "workbench.colorTheme": "GitHub Dark",
  "git.openRepositoryInParentFolders": "never",
  "workbench.productIconTheme": "fluent-icons",
  "editor.letterSpacing": -0.2,
  "terminal.integrated.smoothScrolling": true
}

Reproduction URL

no need

Describe your issue
image

VSCode Hangs indefinitely while Formatting on save since version 0.9.8 and above.
This can start happening between 10-30 min after starting a coding session.
Disabling this extension solves the Issue, can you please take a look?

@glekner glekner changed the title VSCode Hangs indefinitely while Formatting on save since version 0.9.9 VSCode Hangs indefinitely while Formatting on save since version 0.9.8 Apr 3, 2023
@bengry
Copy link

bengry commented Apr 3, 2023

I've had this issue as well, and after disabling tailwindCSS.validate, I think it's pretty much gone. So that's probably the root cause, not anything else in the extension.

@binaryartifex
Copy link

also have this issue on windows OS in my nrwl/nx monorepo. recent occurrence. about 10-30 min in my project becomes unusable and im forced to constantly enable/disable this extension or shut down/start up vscode entirely

@ptrxyz
Copy link

ptrxyz commented Apr 10, 2023

yep, also observing this. can i simply downgrade until this is fixed?

@thecrypticace
Copy link
Contributor

Do you all have the prettier extension installed? If so, if you downgrade to v0.2.5 do you still see this issue?

@ptrxyz
Copy link

ptrxyz commented Apr 10, 2023

@thecrypticace Do you mean this one? https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
I am using it, version 9.10.4. However the last release is months ago and I am pretty sure the issue is not that old.

@thecrypticace
Copy link
Contributor

That is the one I'm talking about yes. There've been reports of slowness regarding the tailwindcss prettier plugin inside VSCode which I'm investigating. I'm not certain yet if they're related. Just gathering data currently.

@bengry
Copy link

bengry commented Apr 10, 2023

That is the one I'm talking about yes. There've been reports of slowness regarding the tailwindcss prettier plugin inside VSCode which I'm investigating. I'm not certain yet if they're related. Just gathering data currently.

I use that extension as well, but not the tailwind plugin for prettier. So I'm not sure that's related.

@thecrypticace
Copy link
Contributor

Ah that's good to know! Thanks!

@bradennapier
Copy link

bradennapier commented Apr 18, 2023

Also running into this. At first i thought it was the custom regex rules but happens with vanilla settings too. It is def always Tailwind + Prettier when it hangs but removing tailwind extension fixes it up

@valgeirb
Copy link

Can we do something to help? This is driving me nuts.

@joneath
Copy link

joneath commented Apr 18, 2023

For those that are experiencing this, is your codebase a Vue app? Do you have the Volar extension installed? I first blamed the Tailwind plugin but removing it did not fix this issue. When viewing the locked up VS Code Extension Host process it has a call chain starting with volar -> prettier -> tailwind. In the Volar issues they have been reporting this bug as well and supposedly it's fixed in the most recent pre-release. 🤞

@bradlc
Copy link
Contributor

bradlc commented Apr 18, 2023

Hey all. I'm more than happy to take a look into this issue but it's going to be incredibly difficult without some more information. If somebody could share the following that would be a great help:

  • A GitHub repository containing a project which can be opened in VS Code to reproduce the issue
  • A list of all installed extensions (code --list-extensions --show-versions)
  • All VS Code settings in JSON format

It would also be interesting to know what everyone is actually seeing when this is happening. Is everyone seeing the code actions message? And does it ever only have Tailwind CSS IntelliSense listed? Or are there always other extensions mentioned?

@glekner, does the issue go away for you if you downgrade to v0.9.7?

@glekner
Copy link
Author

glekner commented Apr 19, 2023

@bradlc I managed to reproduce the issue with v0.9.7 now.
Not sure how to proceed here, could this be a combination with the prettier extension?
Anyway we can rule out the issue being coupled with 0.9.8.

@fturmel
Copy link

fturmel commented Apr 19, 2023

@bradlc I am experiencing this issue as well in a NextJS 13 and TypeScript codebase. I did see the code actions message too, both Tailwind CSS IntelliSense and ESLint were listed but will take screenshots next time.

VS Code extensions
VS Code user settings

{
	"explorer.confirmDelete": false,
	"files.autoSave": "onFocusChange",
	"editor.renderWhitespace": "none",
	"editor.autoClosingBrackets": "always",
	"editor.autoClosingQuotes": "always",
	"window.restoreWindows": "all",
	"eslint.packageManager": "yarn",
	"npm.packageManager": "yarn",
	"javascript.updateImportsOnFileMove.enabled": "always",
	"explorer.confirmDragAndDrop": false,
	"editor.codeActionsOnSave": {
		"source.organizeImports": true,
		"source.fixAll.eslint": false
	},
	"workbench.colorTheme": "Material Theme Palenight High Contrast",
	"workbench.iconTheme": "material-icon-theme",
	"workbench.colorCustomizations": {},
	"editor.fontSize": 13,
	"git.autofetch": true,
	"[javascript]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"[html]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"typescript.updateImportsOnFileMove.enabled": "always",
	"[json]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"[python]": {
		"editor.defaultFormatter": "ms-python.python",
		"editor.formatOnType": true
	},
	"versionlens.npm.caching.duration": 1,
	"versionlens.suggestions.showOnStartup": true,
	"[svelte]": {},
	"go.autocompleteUnimportedPackages": true,
	"go.useLanguageServer": true,
	"[go]": {
		"editor.defaultFormatter": "golang.go"
	},
	"[typescript]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"[typescriptreact]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"workbench.tree.indent": 16,
	"workbench.tree.renderIndentGuides": "always",
	"files.autoSaveDelay": 5000,
	"prettier.tabWidth": 4,
	"prettier.singleQuote": true,
	"prettier.printWidth": 120,
	"prettier.jsxSingleQuote": true,
	"prettier.arrowParens": "avoid",
	"[jsonc]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"prettier.trailingComma": "all",
	"files.associations": {
		"*.rmd": "markdown"
	},
	"workbench.editorAssociations": {
		"*.ipynb": "default"
	},
	"workbench.startupEditor": "newUntitledFile",
	"[c]": {
		"editor.wordBasedSuggestions": false,
		"editor.suggest.insertMode": "replace",
		"editor.semanticHighlighting.enabled": true
	},
	"[css]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"todo-tree.general.tags": ["BUG", "HACK", "FIXME", "TODO", "XXX", "[ ]", "[x]"],
	"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^\\s*(-|\\d+.))\\s*($TAGS)",
	"go.toolsManagement.autoUpdate": true,
	"workbench.panel.defaultLocation": "right",
	"editor.linkedEditing": true,
	"editor.suggestSelection": "first",
	"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
	"python.defaultInterpreterPath": "/opt/homebrew/bin/python3",
	"git.allowForcePush": true,
	"python.formatting.provider": "black",
	"[javascriptreact]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"[dockercompose]": {
		"editor.defaultFormatter": "ms-azuretools.vscode-docker"
	},
	"files.exclude": {
		"**/.classpath": true,
		"**/.project": true,
		"**/.settings": true,
		"**/.factorypath": true
	},
	"[markdown]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"diffEditor.ignoreTrimWhitespace": false,
	"python.analysis.typeCheckingMode": "basic",
	"prettier.useTabs": true,
	"git.confirmSync": false,
	"emmet.excludeLanguages": ["markdown", "javascriptreact", "typescriptreact"],
	"breadcrumbs.enabled": false,
	"editor.minimap.enabled": false,
	"eslint.codeActionsOnSave.rules": null,
	"deno.inlayHints.parameterNames.enabled": "none",
	"deno.inlayHints.parameterTypes.enabled": false,
	"deno.inlayHints.enumMemberValues.enabled": false,
	"deno.inlayHints.functionLikeReturnTypes.enabled": false,
	"deno.inlayHints.variableTypes.enabled": false,
	"terminal.integrated.env.osx": {},
	"editor.wordWrap": "on",
	"editor.formatOnSave": true,
	"editor.tabSize": 2,
	"settingsSync.ignoredSettings": []
}

@bradlc
Copy link
Contributor

bradlc commented Apr 19, 2023

@glekner and @fturmel, have either of you tried disabling the ESLint extension to see if that makes a difference?

@fturmel
Copy link

fturmel commented Apr 19, 2023

@glekner and @fturmel, have either of you tried disabling the ESLint extension to see if that makes a difference?

I have not, but if I encounter the problem again today I will try to disable the ESLint and Prettier plugins and report back.

@marthoff
Copy link

image

This is the screenshot. The error occurs randomly. I think it might be connected if the css or javascript is not correct. I experience it often, when my code is not complete, but I like to save in between.

@marthoff
Copy link

Another guess: I think the problem occurs when I have the tailwind prettier plugin and intelli sense running.

@bengry
Copy link

bengry commented Apr 19, 2023

Another guess: I think the problem occurs when I have the tailwind prettier plugin and intelli sense running.

#755 (comment)

Maybe, but it's not the only cause, if it is indeed related. But maybe there's a common dominator with the eslint extension, since I am using that.

@marthoff
Copy link

I turned off the tailwind prettier plugin (removed .prettierrc and npm remove plugin) and no more problems since then.

@joneath
Copy link

joneath commented Apr 20, 2023

☝️ removing the tailwind prettier plugin from package.json fixed the issue for me too.

@glekner
Copy link
Author

glekner commented Apr 21, 2023

me and @bengry don't have tailwind prettier plugin installed, we still face the issue.

@bengry
Copy link

bengry commented May 1, 2023

As @glekner mentioned, we don't use https://github.com/tailwindlabs/prettier-plugin-tailwindcss, but we do use https://github.com/francoismassart/eslint-plugin-tailwindcss, and have the classnames-order rule enabled, which apparently uses something related to prettier under the hood. Although it does implement everything itself due to the naming I suspect it might've copied a bunch of code from the prettier plugin for tailwind for that, so that code might be the underlying issue here.

@bradlc
Copy link
Contributor

bradlc commented May 2, 2023

@bengry, if you disable/remove eslint-plugin-tailwindcss does the issue go away?

@bengry
Copy link

bengry commented May 16, 2023

@bengry, if you disable/remove eslint-plugin-tailwindcss does the issue go away?

Sorry for the delayed response, had a bunch of things come up and I haven't had the time to check this.
Anyway, I just commented out anything tailwind-related in my ESLint config and it still seems to hang up VS Code very often after updating to the latest version of the extension.

@wescopeland
Copy link

wescopeland commented May 16, 2023

This issue seems to go away when I force downgrade VSCode to 1.76.2. Not saying that is a viable long-term solution, but it at least got me moving again.

@WoodyWoodsta
Copy link

I've been butting my head against this. Even without this extension installed, saving would hang, specifically being stuck on the prettier formatting phase.

For me, removing the prettier-plugin-tailwind resolved the issue. I'm not sure why that is the case though - perhaps a race condition of some sort?

@hasokeric
Copy link

hasokeric commented Jun 4, 2023

Everytime mine hangs I see this in the Extension host, perhaps unrelated.

2023-06-04 16:02:30.957 [error] [bradlc.vscode-tailwindcss] provider FAILED
2023-06-04 16:02:30.980 [error] TypeError: Cannot read properties of null (reading 'filter')
    at Object.<anonymous> (c:\Users\Haso\.vscode-insiders\extensions\bradlc.vscode-tailwindcss-0.9.10\dist\extension.js:43:11904)
    at Generator.next (<anonymous>)
    at s (c:\Users\Haso\.vscode-insiders\extensions\bradlc.vscode-tailwindcss-0.9.10\dist\extension.js:1:1247)

But I also noticed it being slow mainly when Copilot is involved.

microsoft/vscode#178799
prettier/eslint-plugin-prettier#304
prettier/prettier-vscode#1333

Edit: I downgraded to VSCode 1.76 and no more issues
I wonder if that is because in 1.78+ they modified VSCode to support Copilot X.
sergei-dyshel/vscode@122c48b
https://vscode.blob.core.windows.net/insider/c9e3ef865539061b5602c6b9ac6030332aa1ce70/VSCodeSetup-x64-1.76.0-insider.exe

@stormynight9
Copy link

Any updates on how to fix this?

@xitanggg
Copy link

I had this issue with prettier-plugin-tailwindcss version 0.3, downgrading it back to say 0.2.1 with npm install --save-dev [email protected] and restarting VSCode solve the issue for me

@thecrypticace
Copy link
Contributor

I'm not 100% certain but it is possible this is related to microsoft/vscode#184926

The fix for this has been merged in but I don't expect it'll be available until the next minor release of VSCode.

@hasokeric
Copy link

I sure hope thats it.

@sumeetadur
Copy link

I'm not 100% certain but it is possible this is related to microsoft/vscode#184926

The fix for this has been merged in but I don't expect it'll be available until the next minor release of VSCode.

microsoft/vscode#184926 (comment):

This ships with 1.80.0-insiders. Anyone is invited to give this a try and report back if the fix does what we want it to do ;-)

I've tried the Insiders build (https://code.visualstudio.com/insiders/) and it's working as expected 👍

@forbesd7
Copy link

I'm not 100% certain but it is possible this is related to microsoft/vscode#184926
The fix for this has been merged in but I don't expect it'll be available until the next minor release of VSCode.

microsoft/vscode#184926 (comment):

This ships with 1.80.0-insiders. Anyone is invited to give this a try and report back if the fix does what we want it to do ;-)

I've tried the Insiders build (https://code.visualstudio.com/insiders/) and it's working as expected 👍

+1 on this, seems to be working smoothly with this release!

@thecrypticace
Copy link
Contributor

Oh this is fantastic news! 🎉 🎉

If anyone here can give VSCode 1.80 a try (it's been out for several days now) and report back. I expect the issues are likely gone as some have experienced.

@davea38
Copy link

davea38 commented Jul 12, 2023

I had this problem pre-1.80 and I have done two things to fix this:

  1. Added a .prettierignore file in the root of my project
build
coverage
.gitlab
.vscode
node_modules
  1. Updated VSCode to 1.80

Still is slightly slow every now and again but it's a massive improvement!

Addons I am using:

image

@Suniron
Copy link

Suniron commented Jul 18, 2023

Same behavior here:

image

How can I disable it? Because it takes a long time (almost 10s) to save my files with that.

This is my .vscode/settings.json configuration:

  "prettier.enable": false,
  "editor.formatOnSave": false,
  "[typescript]": {
    "editor.codeActionsOnSave": {
      "source.fixAll": false,
      "source.fixAll.eslint": true,
    },
  },

Windows 10 + WSL2 (Ubuntu).

In a monorepo turborepo/nuxt/vue/typescript

@glekner
Copy link
Author

glekner commented Jul 18, 2023

Made a change couple of days ago and it seems like the issue is gone.
Try to go to the Output of the extension and see if it tries to parse a very large file, for me it was yarn.lock:

[tailwind.config.js] File changed: /src/yarn.lock
[tailwind.config.js] Initializing...
[tailwind.config.js] File changed: /src/yarn.lock
[tailwind.config.js] Initializing...
[tailwind.config.js] File changed: /src/yarn.lock
[tailwind.config.js] Initializing...

Since adding it to the Files exclude property i'm not experiencing the issue anymore
image

@bradlc can you share your thoughts here? and why does the extension even parse these files?

@bradlc
Copy link
Contributor

bradlc commented Jul 18, 2023

Hey @glekner. The extension does not parse yarn.lock files. It watches it for changes only.

Are you certain that the improvement you're seeing is because of the configuration change, or could it be because you have upgraded VS Code to v1.80 as @thecrypticace mentioned?

@glekner
Copy link
Author

glekner commented Jul 18, 2023

@bradlc I have this configuration

    "tailwindCSS.validate": false,
    "tailwindCSS.lint.recommendedVariantOrder": "ignore",
    "tailwindCSS.codeActions": false,
    "tailwindCSS.files.exclude": [
      "**/.git/**",
      "**/node_modules/**",
      "**/.hg/**",
      "**/.svn/**",
      "**/yarn.lock",
      "**/@generated/**"
    ]

could it be related to code actions?

@davea38
Copy link

davea38 commented Jul 19, 2023

@bradlc Is there a way to point this plugin at an exclusion file (such as .prettierignore or .eslintignore)? There's lots of discussion on the prettier / eslint github issues on centralising exclusions. The typical way is to point the addons via the package.json at an exclude file in the .gitignore format

@bradlc
Copy link
Contributor

bradlc commented Aug 16, 2023

@glekner, are you still able to reproduce the issue on the latest version of VS Code (currently 1.81.1)?

@glekner
Copy link
Author

glekner commented Aug 17, 2023

Issue is gone @bradlc , but i'm not sure its related to VSCode version.
this is my config

    "tailwindCSS.validate": false,
    "tailwindCSS.lint.recommendedVariantOrder": "ignore",
    "tailwindCSS.codeActions": false,
    "tailwindCSS.files.exclude": [
      "**/.git/**",
      "**/node_modules/**",
      "**/.hg/**",
      "**/.svn/**",
      "**/yarn.lock",
      "**/@generated/**"
    ]

could it be related to code actions?

@bradlc
Copy link
Contributor

bradlc commented Aug 17, 2023

@glekner If you set tailwindCSS.codeActions to true does the issue come back?

@localpath
Copy link

Still causes major issues for me both in monorepos running nextjs13, nextjs12, nestjs and some using containers for local dev others no containers.

Seems like for me the "tailwindCSS.validate": false fixes the issue. Nextjs 13 would take around 30sec to compile and with the setting to false takes around 9s for first compile, around 8s with the plugin completely disabled. (inside container on mounted shared volumes using turborepo).

@thecrypticace
Copy link
Contributor

@localpath do you mean it would take around 30s for it to provide completions? The intellisense extension does not run as part of the nextjs build process (I guess unless you're running the language server yourself during the build).

@thecrypticace thecrypticace self-assigned this Nov 2, 2023
@thecrypticace
Copy link
Contributor

I've done some perf testing of diagnostics and don't seem to be able to reproduce perf issues here in the latest version of VSCode.

Because this issue has had very little activity in the last couple of months and not enough info available to reliably reproduce — I'm going to go ahead and close it.

If this issue pops up again, please leave a comment with details on your VSCode setup (version, config, all installed extensions), a repository that can be cloned to reproduce this issue, and information about how you're using Intellisense (for instance — is it in a Remote workspace over SSH) and I will take a look again.

@TheGreatDaniad
Copy link

I have literally done all of the suggested solutions. Non worked for me!

@localpath
Copy link

@thecrypticace sorry for the late response. It would cause the Nextjs dev server to hang or become unfunctional after a few minutes. I think it was just some weird interaction with WSL 2, Docker shared volumes, HMR, and VSCode sort of bottlenecking or causing things trying to access the filesystem to hang.

Doesn't seem to happen anymore so not sure if Nextjs or VSCode did something that fixed it.

@niczyporukm
Copy link

Mentioned behaviors may be caused by other VS Code plugins that analyze files onSave. Disabling the "Auto Import - ES6, TS, JSX, TSX" plugin solved the issue in my case.

@kimsuyeon0916
Copy link

Remove the yarn.lock file and then run the yarn install command.
The problem may be caused by a damaged yarn.lock file and less installed dependencies. I solved this problem like this.

rm yarn.lock
yarn install

@channprj
Copy link

@glekner You saved my time a lot.

Also, I removed auto import extension, too. Check your Output in vscode. You can see reasons for taking it slow.

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