Open yuemin-hu-20231024 opened 2 months ago
I am having the same issue. This has started recently. I tried reverting to the previous version, but to no avail. Also of interest, I have other VSCode workspaces in which Prettier is working fine.
I am also having this issues in one of my workspaces
["ERROR" - 3:29:58 PM] Error resolving prettier configuration for <file>.ts
["ERROR" - 3:29:58 PM] this.prettierModule.resolveConfigFile is not a function
TypeError: this.prettierModule.resolveConfigFile is not a function
at t.PrettierMainThreadInstance.resolveConfigFile (<path>/.vscode/extensions/esbenp.prettier-vscode-10.4.0/dist/extension.js:1:18684)
at t.ModuleResolver.resolveConfig (<path>/.vscode/extensions/esbenp.prettier-vscode-10.4.0/dist/extension.js:1:6856)
at t.ModuleResolver.getResolvedConfig (<path>/.vscode/extensions/esbenp.prettier-vscode-10.4.0/dist/extension.js:1:7735)
at async t.default.format (<path>/.vscode/extensions/esbenp.prettier-vscode-10.4.0/dist/extension.js:1:14767)
at async t.PrettierEditProvider.provideEdits (<path>/.vscode/extensions/esbenp.prettier-vscode-10.4.0/dist/extension.js:1:12876)
But other workspaces are having no issues (yet)
For me the root cause of this was related to this issue found over in Microsoft's vscode-eslint repo. There's a lot at play there, so I'll let the issue speak for itself.
I am also having this issues in one of my workspaces
["ERROR" - 3:29:58 PM] Error resolving prettier configuration for <file>.ts ["ERROR" - 3:29:58 PM] this.prettierModule.resolveConfigFile is not a function TypeError: this.prettierModule.resolveConfigFile is not a function at t.PrettierMainThreadInstance.resolveConfigFile (<path>/.vscode/extensions/esbenp.prettier-vscode-10.4.0/dist/extension.js:1:18684) at t.ModuleResolver.resolveConfig (<path>/.vscode/extensions/esbenp.prettier-vscode-10.4.0/dist/extension.js:1:6856) at t.ModuleResolver.getResolvedConfig (<path>/.vscode/extensions/esbenp.prettier-vscode-10.4.0/dist/extension.js:1:7735) at async t.default.format (<path>/.vscode/extensions/esbenp.prettier-vscode-10.4.0/dist/extension.js:1:14767) at async t.PrettierEditProvider.provideEdits (<path>/.vscode/extensions/esbenp.prettier-vscode-10.4.0/dist/extension.js:1:12876)
But other workspaces are having no issues (yet)
On my side the issue seems to be solved on its own
Surely an update did it, but is unknown to me if it was from vscode
or prettier
Summary
Prettier files a error message when using 'format document with -> prettier'
Github Repository to Reproduce Issue
-
Steps To Reproduce:
Prettier files a error message when using 'format document with -> prettier'
Expected result
Describe what should have happened.
Actual result
Here's the log:
👇 when I restarted the editor
👇when focusing any editor window
👇when trying 'format document with prettier'
Additional information
VS Code Version: Version: 1.85.2 (Universal)
Prettier Extension Version: 10.4.0
Prettier package version: 3.2.2
Other Libs: "@trivago/prettier-plugin-sort-imports": "^4.1.1", "eslint-config-prettier": "8.5.0", "eslint-plugin-prettier": "5.1.3",
OS and version: Mac OS 13.6.3 (22G436)
Prettier Log Output