Closed equinusocio closed 3 days ago
Did you get any warnings when you installed dependencies about prettier not meeting the peer dependency requirements of style-dictionary, namely it being 2.8.8 and style-dictionary requires 3.0.0 or higher? I'm not sure how PNPM handles these but in NPM you would get a fatal error upon installation:
To my knowledge this can only be fixed by migrating to Prettier v3
Running npm install --legacy-peer-deps
will just ignore the peer dep and result in the error which you are now getting because then it resolves the prettier 3.x.x peer dep on the v2 installation and that's missing the babel plugin.
Same for --force
flag.
NPM "overrides" also doesn't seem to work as expected, I would expect:
{
"dependencies": {
"prettier": "2.8.8",
"style-dictionary": "^4.2.0"
},
"overrides": {
"prettier": "^2.8.8",
"style-dictionary": {
"prettier": "$prettier"
// $prettier means "take the version from style-dictionary's dependency on prettier".
//^3.0.0 also doesn't work. I guess overrides ignores peer deps... >.>
}
}
}
To install prettier v2 in the root node_modules
and prettier v3 in node_modules/style-dictionary/node_modules
which is what would happen if prettier was a regular dependency and not a peer dependency of style-dictionary, but NPM apparently disagrees with me. Doesn't seem like any filed a bug report for this yet....
I don't use PNPM so I don't know exactly how they resolve peer dependency conflicts, you'll have to do some research there and some npm ls prettier
to figure out what will make PNPM install prettier v2 and v3 correctly. Or just migrate to Prettier v3 I suppose. Good luck!
Did you get any warnings when you installed dependencies about prettier not meeting the peer dependency requirements of style-dictionary, namely it being 2.8.8 and style-dictionary requires 3.0.0 or higher?
Nope, pnpm installs without errors or warnings with both SD 4.1 and 4.2.
Any release ETA for this fix?
I wanna get these into the release as well, probably end of this week / beginning of next week. All of these PRs are 95%+ done
We get this error after upgrading to 4.2. Reverting to 4.1 works as expected