There is no formatter for 'shellscript' files installed.
Summary
When using the Prettier VSCode extension with prettier-plugin-sh, I receive the message "There is no formatter for 'shellscript' files installed." when running the command "Format Document" on a .sh file.
Github Repository to Reproduce Issue
https://github.com/markuslewin/prettier-sh-no-formatter
Steps To Reproduce:
- Run
npm install - Open
file.shin VSCode - Run command "Format Document"
- "There is no formatter for 'shellscript' files installed."
Expected result
The file file.sh should be formatted.
Actual result
I receive the message "There is no formatter for 'shellscript' files installed.".
Additional information
It seems like the problem is that some of the plugin's language objects include functions that cause the calls to postMessage to throw here and here.
Related issue in the Prettier repo: https://github.com/un-ts/prettier/issues/489.
VS Code Version:
Version: 1.104.3 (user setup)
Commit: 385651c938df8a906869babee516bffd0ddb9829
Date: 2025-10-02T12:30:51.747Z
Electron: 37.3.1
ElectronBuildId: 12404162
Chromium: 138.0.7204.235
Node.js: 22.18.0
V8: 13.8.258.31-electron.0
OS: Windows_NT x64 10.0.26100
Prettier Extension Version: 11.0.0
Prettier Log Output
["INFO" - 3:53:59 PM] Extension Name: esbenp.prettier-vscode.
["INFO" - 3:53:59 PM] Extension Version: 11.0.0.
["DEBUG" - 3:53:59 PM] Enabling Prettier globally
{
"languageSelector": [
{
"language": "javascript"
},
{
"language": "mongo"
},
{
"language": "javascriptreact"
},
{
"language": "typescript"
},
{
"language": "typescriptreact"
},
{
"language": "json"
},
{
"language": "jsonc"
},
{
"language": "json5"
},
{
"language": "css"
},
{
"language": "postcss"
},
{
"language": "less"
},
{
"language": "scss"
},
{
"language": "handlebars"
},
{
"language": "graphql"
},
{
"language": "markdown"
},
{
"language": "mdx"
},
{
"language": "html"
},
{
"language": "vue"
},
{
"language": "yaml"
},
{
"language": "ansible"
},
{
"language": "home-assistant"
},
{
"language": "jsonc",
"scheme": "vscode-userdata"
}
],
"rangeLanguageSelector": [
{
"language": "javascript"
},
{
"language": "javascriptreact"
},
{
"language": "typescript"
},
{
"language": "typescriptreact"
},
{
"language": "json"
},
{
"language": "jsonc"
},
{
"language": "graphql"
}
]
}
["DEBUG" - 3:54:05 PM] Local prettier module path: /home/markus/projects/prettier-sh-no-formatter/node_modules/prettier/index.cjs
["DEBUG" - 3:54:05 PM] Using prettier version 3.6.2
["INFO" - 3:54:05 PM] Using config file at /home/markus/projects/prettier-sh-no-formatter/.prettierrc
["ERROR" - 3:54:05 PM] Error handling text editor change
["ERROR" - 3:54:05 PM] function({ filepath }) {
const basename = path.basename(filepath);
return basename === ".env" || ba...<omitted>... } could not be cloned.
DataCloneError: function({ filepath }) {
const basename = path.basename(filepath);
return basename === ".env" || ba...<omitted>... } could not be cloned.
at new DOMException (node:internal/per_context/domexception:66:5)
at p (/home/markus/.vscode-server/extensions/esbenp.prettier-vscode-11.0.0/dist/worker/prettier-instance-worker.js:1:657)
at /home/markus/.vscode-server/extensions/esbenp.prettier-vscode-11.0.0/dist/worker/prettier-instance-worker.js:1:914
For context, all the maintainers need to do to fix this bug is to just to update Prettier to the latest version and push a new release, but unfortunately I think this project is unmaintained. See: #3743
This issue should be resolved in version 12 of the extension. Version 12 is currently in preview and is published only to the new Prettier organization. You can find that version here: https://marketplace.visualstudio.com/items?itemName=Prettier.prettier-vscode
Once we decide version 12 is stable it will be published to the old extension location as well.
Please test this issue in version 12 and let me know if this is still an issue. If we don't hear back this issue may be closed.
Can confirm this works in [email protected]! Thank you!