Error during upgrade from v0.39.4 to 0.40.0

I am a bit behind with my RW version. Since v1 is being launched soon I want to be up to date. The plan was to upgrade incrementally through all the versions that were released. I was on v0.39.4 so I ran:

yarn redwood upgrade --tag 0.40.0

I got the following error:

✖ De-duplicating dependencies
Could not finish deduplication. If the project is using yarn 1.x, please run `npx yarn-deduplicate`, before continuing
error Command failed with exit code 1.

So I ran
npx yarn-deduplicate

Which worked successfully. I reran the upgrade command and it fails with the same error above.

My yarn version is v1.22.18. Do I need to upgrade to yarn 2 or 3? I can’t find anything that suggests that. If I start my app now, it gives some errors which I assume are a result of the failed upgrade command. What are some things I can do to resolve this error?

Upgrading Yarn to v3 was not the right thing to do. I did that and it “couldn’t find a script named redwood”. More details on why that happens here Enable yarn 3 for Redwood projects by jtoar · Pull Request #4444 · redwoodjs/redwood · GitHub

I switched back to Yarn 1 by using

yarn set version classic

Which actually set my Yarn version as 1.23.0-20220130.1630 rather than v1.22.18. I still get the same error above when trying to upgrade though.

Despite this error it looks like the upgrade did work successfully. The errors I had when running the application involved a relative path in my CSS. I am not sure which feature/fix in v0.40.0 impacted this but it works now so I am moving on. Onward to v1 :wink: