You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use .prettierrc.json to load my prettier-config from node_modules. This works in command line prettier.
When I try to use the formatter, however, it fails, telling me my prettier config is invalid. Cannot find module '@lusito/prettier-config' from '<my-root-path>'
Github Repository to Reproduce Issue
Link to a Github repo that can be used to reproduce the issue.
Steps To Reproduce:
Create an NPM project
Install a prettier config, for example mine: @lusito/prettier-config.
Create a .prettierrc.json with content "@lusito/prettier-config"
Use prettier code-formatter => boom
Expected result
It should work just like the CLI
Actual result
An error message shows up
Additional information
VS Code Version: 1.43.2
Prettier Extension Version: 4.0.0. It works when I switch back to 3.2.0 (though trailing commas seems to be different for some reason)
OS and version: Win7
Prettier Log Output
["INFO" - 12:42:03] Extension Name: "prettier-vscode".
["INFO" - 12:42:03] Extension Version: "4.0.0".
["INFO" - 12:42:03] Enabling prettier for languages
[
"css",
"graphql",
"html",
"javascript",
"javascriptreact",
"json",
"json5",
"jsonc",
"less",
"markdown",
"mdx",
"mongo",
"postcss",
"scss",
"typescript",
"typescriptreact",
"vue",
"yaml"
]
["INFO" - 12:42:03] Enabling prettier for range supported languages
[
"graphql",
"javascript",
"javascriptreact",
"json",
"typescript",
"typescriptreact"
]
["INFO" - 12:42:04] Formatting <my-root-path>\src\setupTests.ts
["ERROR" - 12:42:04] Invalid prettier configuration file detected.
["ERROR" - 12:42:04] Cannot find module '@lusito/prettier-config' from '<my-root-path>'
Error: Cannot find module '@lusito/prettier-config' from '<my-root-path>'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:717:15)
at Function.n.resolve (c:\Users\Lusito\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:15:584)
at Object.transform (<my-vscode-path>\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\index.js:23283:40)
at run (<my-vscode-path>\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11472:51)
at async cacheWrapper (<my-vscode-path>\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11300:20)
at async cacheWrapper (<my-vscode-path>\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11300:20)
at async Explorer.search (<my-vscode-path>\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11457:22)
at async Promise.all (index 0)
["INFO" - 12:57:01] Formatting <my-root-path>\src\setupTests.ts
["ERROR" - 12:57:01] Invalid prettier configuration file detected.
["ERROR" - 12:57:01] Cannot find module '@lusito/prettier-config' from '<my-root-path>'
Error: Cannot find module '@lusito/prettier-config' from '<my-root-path>'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:717:15)
at Function.n.resolve (c:\Users\Lusito\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:15:584)
at Object.transform (<my-vscode-path>\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\index.js:23283:40)
at run (<my-vscode-path>\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11472:51)
at async cacheWrapper (<my-vscode-path>\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11300:20)
at async cacheWrapper (<my-vscode-path>\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11300:20)
at async Explorer.search (<my-vscode-path>\extensions\esbenp.prettier-vscode-4.0.0\node_modules\prettier\third-party.js:11457:22)
at async Promise.all (index 0)
The text was updated successfully, but these errors were encountered:
Summary
I use .prettierrc.json to load my prettier-config from node_modules. This works in command line prettier.
When I try to use the formatter, however, it fails, telling me my prettier config is invalid.
Cannot find module '@lusito/prettier-config' from '<my-root-path>'
Github Repository to Reproduce Issue
Link to a Github repo that can be used to reproduce the issue.
Steps To Reproduce:
@lusito/prettier-config
."@lusito/prettier-config"
Expected result
It should work just like the CLI
Actual result
An error message shows up
Additional information
VS Code Version: 1.43.2
Prettier Extension Version: 4.0.0. It works when I switch back to 3.2.0 (though trailing commas seems to be different for some reason)
OS and version: Win7
Prettier Log Output
The text was updated successfully, but these errors were encountered: