-
Our builds have been failing with the following error and we think it might be related to this update based on timing, though I'm not sure how that's affecting us. We're on core 9.3.5. Could we have something configured incorrectly? (Twilio repo linked in help-design-systems)
Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
👋 do you mind posting the list of dependencies you have in your package json? Color utils only appeared in core in 10.3 I think, so it seems weird that it suddenly complains about it. Did you do a package update? |
Beta Was this translation helpful? Give feedback.
-
I think it's related to this dependency that was added to paste/theme 5.3.0 e268bfd#diff-0e3bddf9b7ad572451bbae12457df1d2052007fd317ec288229c918511dbad56R27 and the core 9.3.5 has it's peer set to |
Beta Was this translation helpful? Give feedback.
-
Our builds pass if we explicitly add paste/theme 5.1.0 as a dependency. |
Beta Was this translation helpful? Give feedback.
-
So, yes, a couple of things are happening here. It is related to the 5.3.0 release of theme, but according to your lockfile you are pinned to 5.1.0
And running locally this seems to work just fine. Is it on a branch? Also has someone blown away a lockfile recently? Unless npm is different to yarn, when you install, even if the peer dep is listed as Ordinarily you wouldn't encounter this problem because the lockfile pins you to a version of the peer deps it needed to satisfy at the time. Anyway, to the now, regardless of the fact npm is now trying to install theme 5.3.0 (and not 5.1.0) when using core v9.3.5, npm, I would hope, is telling you you have a mismatched or missing peer dependency when you install. It should tell you the package missing before you get to the build. Is it doing that at least? The root cause is a risk we took on due to peer dependencies. If you want to guarantee install success every time you either have to:
So we took the option to favour really nice changesets and version bumping (and also because @vnguyen94 complained), at the risk of potentially having someone meet an unmet or missing peer dependency in an upgrade. Weighing that off with it being a low risk as the lockfile and install warnings should save you when peer dependencies are out of sync. Unfortunately, those things did not save you today. One nice thing about independent versions of child deps is that you can upgrade what you want and pin what you don't. As you've discovered with explicitly resolving theme to 5.1.0. This would work pretty well most of the time... except when it won't. You mention not wanting to upgrade because of creative styling choices. Problem is, if you have blown away the lockfile, you've bumped everything within range. So even if you pin theme, you might have bumped all peer dependent packages that Paste core relies on regardless. So, long story short:
|
Beta Was this translation helpful? Give feedback.
-
Thank you for the thorough explanation! The broken build was originally noticed on a branches failing PR validation, but I later noticed we couldn't build main locally either (despite it obviously having been built at some point...) Something must have gotten out of sync with the lockfile because the Jenkins logs show theme 5.3.0 being installed on the failing validations. npm was not warning us of any missing dependencies and we had no issues running the local webpack server; only PR validation and local Docker builds were failing. Our team has been discussing whether (and how) this might have to do with how npm makes decisions between node_modules and package.json. If it was deciding to skip certain upgrades, it could also explain why we were seeing other odd behavior, like secondary Buttons being a different color locally than in deployed builds. I think our next step is to prioritize upgrading core to 10.3.0, and pin any other broken dependencies that pop up in the meantime if necessary. 🩹 |
Beta Was this translation helpful? Give feedback.
So, yes, a couple of things are happening here. It is related to the 5.3.0 release of theme, but according to your lockfile you are pinned to 5.1.0
And running locally this seems to work just fine. Is it on a branch? Also has someone blown away a lockfile recently?
Unless npm is different to yarn, when you install, even if the peer dep is listed as
"^5.1.0"
in core, it shouldn't be trying to get the latest because the lockfile is…