-
-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to resolve custom configuration module #1289
Comments
@lipis Would you mind looking at this? It looks like prettier 2.0 may have broken I have confirmed that I can reproduce this. |
Hmmm.. Can you post an issue on Prettier directly?! I'm not aware of this change.. |
Turns out it's an upstream bug or breaking change with Prettier. A temporary fix per @ntotten is to change your |
Prettier config in package.json is broken with new version vscode plugin, but it's OK with 1. my prettier config // ./pacakges/chores/prettier.js
module.exports = {
printWidth: 100,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
quoteProps: 'consistent',
jsxSingleQuote: false,
trailingComma: 'all',
bracketSpacing: true,
jsxBracketSameLine: false,
arrowParens: 'always',
rangeStart: 0,
rangeEnd: Infinity,
requirePragma: false,
insertPragma: false,
proseWrap: 'preserve',
htmlWhitespaceSensitivity: 'css',
vueIndentScriptAndStyle: true,
endOfLine: 'lf',
}; 2. prettier key in package.json ❌ {
"prettier": "./packages/chores/prettier",
} 3. prettier.config.js ✅ module.exports = require('./packages/chores/prettier'); 4. error screenshot from vscode |
A PR is open on prettier to resolve this, hopefully it can be released quickly into a patch release. I will update the extension as soon as this is read. |
@ntotten Prettier 2.0.3 is out. |
This seems to still be broken for me, I made a minimal repro here: Running the actual prettier cli works fine, it just does not seem to resolve it via the extension. Probably worth noting this is a mono-repo, so to properly recreate: I would just copy the files from the specific linked sub-package. Also note that the issue occurs out of a mono-repo, I just store all my repros in a single repo so I don't have to create new ones every time. Environment details:
Error summary:
|
@AndrewLeedham The new version of the extension, which bundles the new version of Prettier, hasn't been released yet. The extension uses the bundled Prettier package to resolve the config files, not the locally installed one. |
@ntotten Please wait a bit more. I'm going to release 2.0.4 because of a severe regression in 2.0.3 (see prettier/prettier#7958). |
I see was not aware of that, slightly confusing given it logs the installed version. Reverting until the new release then. Thanks @thorn0 😃 |
@ntotten 2.0.4 is out |
Issue fixed in version 4.1.1 published which has prettier 2.0.4. Thanks for the rapid fix @thorn0! |
I am still having the same problem |
@mohsinxx365 Please fill a proper bug report. |
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. |
Summary
It seems that version
4.0.0
released a few hours ago breaks importing/using custom Prettier configs. Downgrading to3.20.0
fixes the issue.I know
4.0.0
would be a breaking change, but I don't see anything in the change logs or in the readme that indicates that custom configs would work differently...Github Repository to Reproduce Issue
https://github.com/greenelab/prettier-config-greenelab
Steps To Reproduce:
npm init
yarn add --dev git+https://[email protected]/greenelab/prettier-config-greenelab.git
.prettierrc.yaml
and put this in it:prettier-config-greenelab
Expected result
The code should format with no errors in the console.
Actual result
The code does not format, and throws errors, as copy-pasted below
Additional information
Feel free to attach a screenshot.
VS Code Version:
1.43.2
Prettier Extension Version:
4.0.0
OS and version: Windows 10 64bit
Prettier Log Output
Note that
node_modules/prettier-config-greenelab
DOES exist in my project. Everything has been installed correctly. I also have aeslint-config-greenelab
installed in the same project as well, which works with no problems. And as I said, downgradingprettier-vscode
in-situ, while in the same project, works.The text was updated successfully, but these errors were encountered: