prettier-vscode
prettier-vscode copied to clipboard
Markdown parser not found using the web-based editor
Summary
Markdown parser is not found when using the web-based editor.
Github Repository to Reproduce Issue
This repository
Steps To Reproduce:
- Open the VS Code web-based editor on this repo
- Make sure the Prettier extension is installed and enabled
- Open
README.md
for editing - Remove the second line (between header and first paragraph)
- Save
Expected result
Format-on-save is supposed to happen, re-introducing the blank line between the header and the text
Actual result
Nothing happens.
Additional information
Format-on-save works for *.js
and *.json
files at least: after modifying e.g. .eslint.js
and saving, format-on-save works correctly.
VS Code Version:
Version: 1.65.2 Commit: c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1 Date: 2022-03-10T14:33:30.517Z (19 hrs ago) Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0
Prettier Extension Version:
v9.3.0
OS and version:
Intel Mac OS X 10.15
Prettier Log Output
["INFO" - 11:20:24] Extension Name: dev.prettier-vscode.
["INFO" - 11:20:24] Extension Version: 0.0.0.
["INFO" - 11:20:24] Using standalone prettier
["INFO" - 11:20:24] Using standalone prettier
["INFO" - 11:20:29] Formatting vscode-vfs://github/prettier/prettier-vscode/README.md
["INFO" - 11:20:29] Using standalone prettier
["INFO" - 11:20:29] File Info:
{
"ignored": false,
"inferredParser": null
}
["WARN" - 11:20:29] Parser not inferred, trying VS Code language.
["ERROR" - 11:20:29] Failed to resolve a parser, skipping file. If you registered a custom file extension, be sure to configure the parser.
I'm running into this issue as well for markdown and JSON files. JS files format as expected.
Startup output:
["INFO" - 4:39:08 PM] Extension Name: dev.prettier-vscode.
["INFO" - 4:39:08 PM] Extension Version: 0.0.0.
["INFO" - 4:39:08 PM] Using standalone prettier
["INFO" - 4:39:08 PM] Using standalone prettier
Markdown file output:
["INFO" - 4:37:24 PM] Formatting vscode-vfs://github-path-to-my-repo/foo.md
["INFO" - 4:37:24 PM] Using standalone prettier
["INFO" - 4:37:24 PM] File Info:
{
"ignored": false,
"inferredParser": null
}
["WARN" - 4:37:24 PM] Parser not inferred, trying VS Code language.
["ERROR" - 4:37:24 PM] Failed to resolve a parser, skipping file. If you registered a custom file extension, be sure to configure the parser.
JSON file output:
["INFO" - 4:35:06 PM] Formatting vscode-vfs://github-path-to-my-repo/bar.json
["INFO" - 4:35:06 PM] Using standalone prettier
["INFO" - 4:35:06 PM] File Info:
{
"ignored": false,
"inferredParser": null
}
["WARN" - 4:35:06 PM] Parser not inferred, trying VS Code language.
["ERROR" - 4:35:06 PM] Failed to resolve a parser, skipping file. If you registered a custom file extension, be sure to configure the parser.
Yep, seeing this as well when trying to edit and tweak Markdown files in various PRs. Would be great to see this fixed!
It is quite weird, this one. I even defined the override to tell prettier which parser to use, but it still gives the same error.
My .prettierrc
:
{
"printWidth": 80,
"proseWrap": "preserve",
"endOfLine": "lf",
"tabWidth": 4,
"overrides": [
{
"files": "*.md",
"options": {
"parser": "markdown",
"printWidth": 80,
"proseWrap": "always"
}
}
]
}
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
Still very much a problem last time I checked.
Same thing, with vscode 1.78. and prettier v9.12.0 Prettier stopped formating
Same here using Turborepo with Svelte and Astro.
prettierrc
// eslint-disable-next-line unicorn/prefer-module, no-undef
module.exports = {
semi: false,
proseWrap: "always",
printWidth: 120,
pluginSearchDirs: ["."],
overrides: [
{
files: "*.md",
options: {
printWidth: 90,
},
},
{
files: "*.svelte",
options: {
parser: "svelte",
},
plugins: ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
svelteStrictMode: true,
},
{
files: "*.astro",
options: {
parser: "astro",
},
plugins: ["prettier-plugin-astro", "prettier-plugin-tailwindcss"],
},
],
};
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
Still seeing this issue. This is the web-based editor version (using Chrome (but same error in Edge as well)):
Version: 1.81.1
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:27:10.293Z
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Prettier version: 10.1.0
Still the same error! Seems It was closed because no one was handling it.
@ntotten can you reopen this issue and prevent it from being auto-closed? It's still relevant.
Or @mathieu1 could create a new issue...
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.