prettier / prettier-vscode

Visual Studio Code extension for Prettier
https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
MIT License
5.17k stars 458 forks source link

Extension 'Prettier - Code formatter' cannot format .... #1839

Closed Namukk closed 3 years ago

Namukk commented 3 years ago

Summary

Even I set format on save and prettier as a default formatter, when I save my code it isn't fixed. It shows error 'Extension 'Prettier - Code formatter' cannot format ....'

Github Repository to Reproduce Issue

https://github.com/Namukk/nomflix

Steps To Reproduce:

  1. Clone code
  2. Try to save it

Expected result

It should fix my code. Even I downloaded extensions and vscode again It shows same error.

Actual result

It doesn't fix my code with error Extension 'Prettier - Code formatter' cannot format ....

Additional information

스크린샷 2021-03-14 오후 10 30 18

VS Code Version: 1.54.2

Prettier Extension Version: 6.2.0

OS and version: macOs Big Sur 11.2.3

Prettier Log Output

["INFO" - 2:50:38 PM] Extension Name: esbenp.prettier-vscode.
["INFO" - 2:50:38 PM] Extension Version: 6.2.0.
["INFO" - 2:50:38 PM] Enabling Prettier globally
["INFO" - 2:50:38 PM] Globally enabled selectors
{
  "languageSelector": [
    {
      "language": "javascript",
      "scheme": "file"
    },
    {
      "language": "mongo",
      "scheme": "file"
    },
    {
      "language": "javascriptreact",
      "scheme": "file"
    },
    {
      "language": "typescript",
      "scheme": "file"
    },
    {
      "language": "typescriptreact",
      "scheme": "file"
    },
    {
      "language": "json",
      "scheme": "file"
    },
    {
      "language": "jsonc",
      "scheme": "file"
    },
    {
      "language": "json5",
      "scheme": "file"
    },
    {
      "language": "css",
      "scheme": "file"
    },
    {
      "language": "postcss",
      "scheme": "file"
    },
    {
      "language": "less",
      "scheme": "file"
    },
    {
      "language": "scss",
      "scheme": "file"
    },
    {
      "language": "graphql",
      "scheme": "file"
    },
    {
      "language": "markdown",
      "scheme": "file"
    },
    {
      "language": "mdx",
      "scheme": "file"
    },
    {
      "language": "html",
      "scheme": "file"
    },
    {
      "language": "vue",
      "scheme": "file"
    },
    {
      "language": "yaml",
      "scheme": "file"
    },
    {
      "language": "ansible",
      "scheme": "file"
    },
    {
      "language": "home-assistant",
      "scheme": "file"
    },
    {
      "language": "javascript",
      "scheme": "untitled"
    },
    {
      "language": "mongo",
      "scheme": "untitled"
    },
    {
      "language": "javascriptreact",
      "scheme": "untitled"
    },
    {
      "language": "typescript",
      "scheme": "untitled"
    },
    {
      "language": "typescriptreact",
      "scheme": "untitled"
    },
    {
      "language": "json",
      "scheme": "untitled"
    },
    {
      "language": "jsonc",
      "scheme": "untitled"
    },
    {
      "language": "json5",
      "scheme": "untitled"
    },
    {
      "language": "css",
      "scheme": "untitled"
    },
    {
      "language": "postcss",
      "scheme": "untitled"
    },
    {
      "language": "less",
      "scheme": "untitled"
    },
    {
      "language": "scss",
      "scheme": "untitled"
    },
    {
      "language": "graphql",
      "scheme": "untitled"
    },
    {
      "language": "markdown",
      "scheme": "untitled"
    },
    {
      "language": "mdx",
      "scheme": "untitled"
    },
    {
      "language": "html",
      "scheme": "untitled"
    },
    {
      "language": "vue",
      "scheme": "untitled"
    },
    {
      "language": "yaml",
      "scheme": "untitled"
    },
    {
      "language": "ansible",
      "scheme": "untitled"
    },
    {
      "language": "home-assistant",
      "scheme": "untitled"
    }
  ],
  "rangeLanguageSelector": [
    {
      "language": "javascript",
      "scheme": "file"
    },
    {
      "language": "javascriptreact",
      "scheme": "file"
    },
    {
      "language": "typescript",
      "scheme": "file"
    },
    {
      "language": "typescriptreact",
      "scheme": "file"
    },
    {
      "language": "json",
      "scheme": "file"
    },
    {
      "language": "graphql",
      "scheme": "file"
    },
    {
      "language": "javascript",
      "scheme": "untitled"
    },
    {
      "language": "javascriptreact",
      "scheme": "untitled"
    },
    {
      "language": "typescript",
      "scheme": "untitled"
    },
    {
      "language": "typescriptreact",
      "scheme": "untitled"
    },
    {
      "language": "json",
      "scheme": "untitled"
    },
    {
      "language": "graphql",
      "scheme": "untitled"
    }
  ]
}
["INFO" - 2:50:38 PM] Using bundled version of prettier.
["INFO" - 2:50:38 PM] Enabling Prettier for Workspace /Users/Namuk/Documents/github/nomflix
["INFO" - 2:50:38 PM] Workspace enabled selectors
{
  "languageSelector": [
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "javascript"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "mongo"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "javascriptreact"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "typescript"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "typescriptreact"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "json"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "jsonc"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "json5"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "css"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "postcss"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "less"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "scss"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "graphql"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "markdown"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "mdx"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "html"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "vue"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "yaml"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "ansible"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.*",
      "scheme": "file",
      "language": "home-assistant"
    },
    {
      "pattern": "/Users/Namuk/Documents/github/nomflix/**/*.{js,_js,bones,cjs,es,es6,frag,gs,jake,jsb,jscad,jsfl,jsm,jss,mjs,njs,pac,sjs,ssjs,xsjs,xsjslib,wxs,js.flow,jsx,ts,tsx,json,avsc,geojson,gltf,har,ice,JSON-tmLanguage,mcmeta,tfstate,tfstate.backup,topojson,webapp,webmanifest,yy,yyp,jsonc,sublime-build,sublime-commands,sublime-completions,sublime-keymap,sublime-macro,sublime-menu,sublime-mousemap,sublime-project,sublime-settings,sublime-theme,sublime-workspace,sublime_metrics,sublime_session,json5,css,wxss,pcss,postcss,less,scss,graphql,gql,graphqls,md,markdown,mdown,mdwn,mkd,mkdn,mkdown,ronn,workbook,mdx,component.html,html,htm,html.hl,inc,st,xht,xhtml,mjml,vue,yml,mir,reek,rviz,sublime-syntax,syntax,yaml,yaml-tmlanguage,yaml.sed,yml.mysql}",
      "scheme": "file"
    }
  ],
  "rangeLanguageSelector": [
    {
      "language": "javascript"
    },
    {
      "language": "javascriptreact"
    },
    {
      "language": "typescript"
    },
    {
      "language": "typescriptreact"
    },
    {
      "language": "json"
    },
    {
      "language": "graphql"
    }
  ]
}
["INFO" - 2:50:57 PM] Using bundled version of prettier.
julians commented 3 years ago

I’ve the same problem. Happens only with the latest version 6.2.0, works with 5.9.2

jwoLondon commented 3 years ago

I too see a similar problem (MacOS Mojave), no formatting with V6.2.0 but does work with 5.9.2.

nikita-beletskiy commented 3 years ago

Same problem with formatting settings.json (VS Code settings), other formats including json ones work fine.

ntotten commented 3 years ago

I am not able to reproduce this issue. Could you provide a copy of your VS Code settings as a JSON document?

ntotten commented 3 years ago

@nikita-beletskiy This is a separate issue. I opened #1845 to track.

jwoLondon commented 3 years ago

Here is my settings file (I've removed the long list of spellcheck exceptions and redacted my username)

{
  "editor.fontFamily": "iosevka,Menlo, Monaco, 'Courier New', monospace",
  "workbench.colorTheme": "Quiet Light",
  "editor.fontSize": 14,
  "markdownlint.config": {
    "MD013": false,
    "MD026": { "punctuation": ".,;:!" },
    "MD030": { "ol_single": 2, "ol_multi": 2 },
    "MD041": false
  },
  "git.autofetch": true,
  "editor.minimap.enabled": false,
  "breadcrumbs.enabled": false,
  "markdown-preview-enhanced-with-litvis.liveUpdate": false,
  "[elm]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "editor.formatOnSave": true,
  "[html]": {
    "editor.defaultFormatter": "vscode.html-language-features"
  },
  "[markdown]": {
    // Controls if the editor should automatically close brackets after opening them
    "editor.autoClosingBrackets": "never"
  },
  "workbench.startupEditor": "newUntitledFile",
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "diffEditor.ignoreTrimWhitespace": false,
  "git.confirmSync": false,
  "workbench.editor.wrapTabs": true,
  "prettier.resolveGlobalModules": true,
  "cSpell.customFolderDictionaries": [

  ],
  "cSpell.enableFiletypes": [
    "elm"
  ],
  "prettier.prettierPath": "/Users/XXXX/.nvm/versions/node/v12.16.2/bin",
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}
nikita-beletskiy commented 3 years ago
{
  "prettier.arrowParens": "avoid",
  "prettier.jsxSingleQuote": true,
  "prettier.singleQuote": true,
  "prettier.trailingComma": "none",
  "editor.formatOnSave": true,
  "editor.accessibilityPageSize": 1,
  "editor.accessibilitySupport": "off",
  "editor.tabSize": 2,
  "editor.hover.delay": 500,
  "editor.fontFamily": "Consolas, monospace",
  "editor.smoothScrolling": true,
  "editor.tabCompletion": "on",
  "editor.cursorStyle": "line-thin",
  "editor.fontSize": 15,
  "editor.minimap.scale": 3,
  "editor.minimap.showSlider": "always",
  "editor.acceptSuggestionOnCommitCharacter": false,
  "editor.wordWrap": "bounded",
  "workbench.commandPalette.history": 0,
  "workbench.enableExperiments": false,
  "workbench.startupEditor": "none",
  "workbench.iconTheme": "material-icon-theme",
  "workbench.colorTheme": "Material Theme Ocean",
  "workbench.editor.limit.perEditorGroup": true,
  "workbench.editor.mouseBackForwardToNavigate": false,
  "workbench.editor.restoreViewState": false,
  "workbench.editor.tabSizing": "shrink",
  "window.zoomLevel": 0.2,
  "window.autoDetectHighContrast": false,
  "update.enableWindowsBackgroundUpdates": false,
  "update.mode": "start",
  "update.showReleaseNotes": false,
  "explorer.confirmDragAndDrop": false,
  "explorer.confirmDelete": false,
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[yaml]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "editor.tokenColorCustomizations": {
    "textMateRules": [
      {
        "scope": "comment",
        "settings": { "foreground": "#659955", "fontStyle": "italic" }
      },
      {
        "scope": "punctuation.definition.comment.js",
        "settings": { "foreground": "#659955" }
      }
    ]
  },
  "emmet.includeLanguages": {
    "javascript": "javascriptreact"
  },
  "kite.showWelcomeNotificationOnStartup": false,
  "kite.loggingLevel": "error",
  "kite.codefinder.enableLineDecoration": false,
  "git.enableSmartCommit": true,
  "liveServer.settings.donotShowInfoMsg": true,
  "liveServer.settings.CustomBrowser": "chrome:PrivateMode",
  "liveSassCompile.settings.formats": [
    {
      "format": "expanded",
      "extensionName": ".css",
      "savePath": "/dist/css"
    }
  ],
  "quokka.showOutputOnStart": false
}
ntotten commented 3 years ago

@jwoLondon The value "/Users/XXXX/.nvm/versions/node/v12.16.2/bin" is not a valid value for prettier.prettierPath. It needs to be to the module path not the bin path.

See: https://github.com/prettier/prettier-vscode#prettierprettierpath

jwoLondon commented 3 years ago

Thanks for that. Hopefully useful information though that having this incorrect path was not a problem prior to V6.2.0. It looks like setting the correct path means "prettier.resolveGlobalModules": true is no longer necessary.

ntotten commented 3 years ago

It looks like setting the correct path means "prettier.resolveGlobalModules": true is no longer necessary.

They do different things. If you don't have a path set, resolveGlobalModules will search your global modules for prettier. If you set a prettierPath that will be used no matter what, no other searches will happen.

I'm not sure why that worked in previous versions. I almost wonder if it failed silently and was falling back to the built-in version of prettier in the extension. v6 is a bit more aggressive on failing on error states.

Namukk commented 3 years ago
{
    "editor.formatOnSave": true,
    "workbench.colorTheme": "Material Theme Darker",
    "workbench.iconTheme": "material-icon-theme",
    "editor.fontSize": 13,
    "[json]": {
        "editor.quickSuggestions": {
            "strings": true
        },
        "editor.suggest.insertMode": "replace"
    },
    "terminal.integrated.automationShell.osx": "",
    "terminal.integrated.shell.osx": "",
    "terminal.integrated.fontFamily": "\"Meslo LG M for Powerline\"",
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "prettier.enableDebugLogs": true,

}
ntotten commented 3 years ago

I am still not able to reproduce this. Are any logs produced when you manually run "Format Document"?

enchained commented 3 years ago
settings.json ```javascript { "telemetry.enableTelemetry": false, "telemetry.enableCrashReporter": false, "git.autofetch": true, "editor.formatOnSave": true, "editor.fontLigatures": true, "javascript.validate.enable": false, "gitlens.advanced.telemetry.enabled": false, "[javascript]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascriptreact]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[typescriptreact]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, "gitlens.views.commits.files.layout": "tree", "prettier.requireConfig": true, "debug.javascript.autoAttachFilter": "disabled", "workbench.editor.decorations.badges": true, "prettier.enableDebugLogs": true, } ```
logs on Prettier start in debug ```javascript ["INFO" - 18:17:15] Extension Name: esbenp.prettier-vscode. ["INFO" - 18:17:15] Extension Version: 6.3.0. ["INFO" - 18:17:15] Enabling Prettier globally ["INFO" - 18:17:15] Globally enabled selectors { "languageSelector": [ { "language": "javascript", "scheme": "file" }, { "language": "mongo", "scheme": "file" }, { "language": "javascriptreact", "scheme": "file" }, { "language": "typescript", "scheme": "file" }, { "language": "typescriptreact", "scheme": "file" }, { "language": "json", "scheme": "file" }, { "language": "jsonc", "scheme": "file" }, { "language": "json5", "scheme": "file" }, { "language": "css", "scheme": "file" }, { "language": "postcss", "scheme": "file" }, { "language": "less", "scheme": "file" }, { "language": "scss", "scheme": "file" }, { "language": "graphql", "scheme": "file" }, { "language": "markdown", "scheme": "file" }, { "language": "mdx", "scheme": "file" }, { "language": "html", "scheme": "file" }, { "language": "vue", "scheme": "file" }, { "language": "yaml", "scheme": "file" }, { "language": "ansible", "scheme": "file" }, { "language": "home-assistant", "scheme": "file" }, { "language": "javascript", "scheme": "untitled" }, { "language": "mongo", "scheme": "untitled" }, { "language": "javascriptreact", "scheme": "untitled" }, { "language": "typescript", "scheme": "untitled" }, { "language": "typescriptreact", "scheme": "untitled" }, { "language": "json", "scheme": "untitled" }, { "language": "jsonc", "scheme": "untitled" }, { "language": "json5", "scheme": "untitled" }, { "language": "css", "scheme": "untitled" }, { "language": "postcss", "scheme": "untitled" }, { "language": "less", "scheme": "untitled" }, { "language": "scss", "scheme": "untitled" }, { "language": "graphql", "scheme": "untitled" }, { "language": "markdown", "scheme": "untitled" }, { "language": "mdx", "scheme": "untitled" }, { "language": "html", "scheme": "untitled" }, { "language": "vue", "scheme": "untitled" }, { "language": "yaml", "scheme": "untitled" }, { "language": "ansible", "scheme": "untitled" }, { "language": "home-assistant", "scheme": "untitled" }, { "language": "jsonc", "scheme": "vscode-userdata" } ], "rangeLanguageSelector": [ { "language": "javascript", "scheme": "file" }, { "language": "javascriptreact", "scheme": "file" }, { "language": "typescript", "scheme": "file" }, { "language": "typescriptreact", "scheme": "file" }, { "language": "json", "scheme": "file" }, { "language": "graphql", "scheme": "file" }, { "language": "javascript", "scheme": "untitled" }, { "language": "javascriptreact", "scheme": "untitled" }, { "language": "typescript", "scheme": "untitled" }, { "language": "typescriptreact", "scheme": "untitled" }, { "language": "json", "scheme": "untitled" }, { "language": "graphql", "scheme": "untitled" } ] } ["INFO" - 18:17:16] Using bundled version of prettier. ["INFO" - 18:17:16] Enabling Prettier for Workspace c:\Users\Ann\projects\crowd-promo ["INFO" - 18:17:16] Workspace enabled selectors { "languageSelector": [ { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "javascript" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "mongo" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "javascriptreact" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "typescript" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "typescriptreact" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "json" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "jsonc" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "json5" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "css" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "postcss" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "less" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "scss" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "graphql" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "markdown" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "mdx" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "html" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "vue" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "yaml" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "ansible" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.*", "scheme": "file", "language": "home-assistant" }, { "pattern": "c:\\Users\\Ann\\projects\\crowd-promo/**/*.{js,_js,bones,cjs,es,es6,frag,gs,jake,jsb,jscad,jsfl,jsm,jss,mjs,njs,pac,sjs,ssjs,xsjs,xsjslib,wxs,js.flow,jsx,ts,tsx,json,avsc,geojson,gltf,har,ice,JSON-tmLanguage,mcmeta,tfstate,tfstate.backup,topojson,webapp,webmanifest,yy,yyp,jsonc,sublime-build,sublime-commands,sublime-completions,sublime-keymap,sublime-macro,sublime-menu,sublime-mousemap,sublime-project,sublime-settings,sublime-theme,sublime-workspace,sublime_metrics,sublime_session,json5,css,wxss,pcss,postcss,less,scss,graphql,gql,graphqls,md,markdown,mdown,mdwn,mkd,mkdn,mkdown,ronn,workbook,mdx,component.html,html,htm,html.hl,inc,st,xht,xhtml,mjml,vue,yml,mir,reek,rviz,sublime-syntax,syntax,yaml,yaml-tmlanguage,yaml.sed,yml.mysql}", "scheme": "file" } ], "rangeLanguageSelector": [ { "language": "javascript" }, { "language": "javascriptreact" }, { "language": "typescript" }, { "language": "typescriptreact" }, { "language": "json" }, { "language": "graphql" } ] } ```

Formatting on saving tsx works, but saving scss doesn't format anymore (since v6 update, works fine after rolling back to 5.9.2) and there's nothing new in Prettier output except ["INFO" - 18:21:08] Using bundled version of prettier..

Are any logs produced when you manually run "Format Document"?

vscode says that there are multiple formatters for scss and offers to choose one to continue, with a list of Prettier x2 (screenshot) image

UPD: After I selected the first one, it seemingly fixed the issue. Any idea why there could be two? It added this to my settings.json:

"[scss]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },

Looks like it worked even without it in v5 for some reason.

nikita-beletskiy commented 3 years ago

Formatting works only if forced, and no output logs neither when just save, nor when try to format manually, just getting a message in a status bar that it cannot format.

Namukk commented 3 years ago

@ntotten No, it doesn't produce

ntotten commented 3 years ago

Try version 6.3.1. I think this should be fixed. Let me know.

Namukk commented 3 years ago

@ntotten Thanks it is working now 👍

jwoLondon commented 3 years ago

Just to note that unfortunately this is still a problem with my setup.

To summarise:

It would appear therefore that something has changed after 5.9.2 that prevents prettier-plugin from picking up global modules installed via nvm.

ntotten commented 3 years ago

@jwoLondon A lot of the time these issues are caused by various version and config settings that are difficult to duplicate. Please provide a sample Github repo that I can use to duplicate this issue. For more details see this guide.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.