-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Downgrading to older Gatsby version throws various errors #25607
Comments
#25478 is the issue that cause this - so you should be able to just pin |
Talking about using caret version selectors - it's never black and white. There is just no good solution to do this. Yes pinning deps could potentially prevent this, but it's not guaranteed as most of dependencies that gatsby use have their own deps using carret version selectors. This is also default behaviour for npm and yarn to use them when adding new package via |
Thanks for the update @pieh. I didn't even think of other dependencies having their own dependencies. It's like a never ending tree. Perhaps caret in dependency management just isn't a great default. |
Have been battling with the similar issue where As @josephmarkus pointed out, for example, because the way caret
you would end up using a different/newer version of What makes the situation more challenging is Been falling back to use I understanding from @pieh 's comment that the use of caret |
It's always a relief to hear that someone else shares the same experience, even if it isn't a pleasant one. It would be great to be able to rollback to any package at a moment in time, rather than feel like buying a cat in a bag where at the time a package was released it worked for 98% of users with setup X and now it may not work at all. It's almost as if versioning fails on its primary purpose. If I pick a package version that throws me errors I also have no way to tell which, in this case, gatsby's own dependency is failing. It just gives you a generic message and off you go to find it on Google, if you are lucky. I spent way too many hours on this and it was very frustrating to try and get something to work. It sometimes feels like a punishment trying to update dependencies - you had something that was working, but no more. The only safe rollback is |
The caret version operator only works as well as the adherence to semver standards of not changing the public API for a given major version. Right now, Gatsby is bringing in a lot of dependencies without maintaining stable interfaces between them. I think exact pinning should be used. Even patch selectors |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Thanks again for being part of the Gatsby community! 💪💜 |
Description
Describe the issue that you're seeing.I decided to upgrade a bunch of outdated gatsby dependencies (see a screenshot from the PR below). Then I discovered a bug (see #25522). I found that the problem was in a particular version of gatsby, so I thought if I simply roll it back to a version before the issue was introduced, it would work smoothly.
These are headline summaries of me trying to pin versions of gatsby with versions of gatsby-cli (it was pointed out in one of the issues that a version of gatsby-cli should be pinned):
gatsby@2.18.0 + gatsby-cli@2.8.12 - broken - Error: Reducers may not dispatch actions.
gatsby@2.18.25 - broken - activities of undefined error (yoga layout)
See - #23214
gatsby@2.19.0 + gatsby-cli@2.8.27 - broken - Error: Reducers may not dispatch actions.
gatsby@2.19.39 - broken - activities of undefined error (yoga layout)
gatsby@2.19.50 + gatsby-cli@2.10.13 - broken - Error: Reducers may not dispatch actions.
gatsby@2.20.24 - broken - Error: Reducers may not dispatch actions.
gatsby@2.20.26 + gatsby-cli@2.11.12 - broken - Error: Reducers may not dispatch actions.
gatsby@2.21.0 - broken
I tried to pin versions of gatsby-cli by adding the following to package.json:
What I came to realise is that EVERY gatsby dependency is prefixed with a caret, so even if I
yarn add gatsby@2.19.0
, all gatsby's own dependencies would be whatever is the latest version than that defined at the time of release, unless I specifically pin them throughresolutions
object (see above)What I would like to do is be able to add a version of gatsby at the time it was released. Currently, I have all sorts of incompatibility issues that break my builds, which is due to all gatsby's own dependencies being newer than gatsby itself.
I spent hours on this and got nowhere. In the end I rolled back my gatsby version to what it was before:
~2.13.x
Steps to reproduce
chore(release): Publish
packages/gatsby/package.json
in files changed and keep this tab open for referenceyarn upgrade gatsby@x.xx.xx
where x represents your chosen gatsby versiongatsby@x.xx.xx
and compare installed packaged versions to those you see in the changelogExpected result
I would expect to see gatsby dependency tree in my
yarn.lock
to match dependency versions outlined inpackage.json
when a given version was releasedActual result
Gatsby dependency versions do not match, leading to various errors as it's unclear which package depends on what.
Environment
The text was updated successfully, but these errors were encountered: