-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Link to the documentation page or resource
https://docs-v4.strapi.io/dev-docs/migration-guides
Describe the bug
I had a really old version of strapi v4 that I upgraded, following the migration guides up to the latest 4.15.5. Things went well and since there was no migration notes since 4.15.5, I went straight to 4.25.22. Yarn install worked but yarn build failed because react is now an explicit dependency.
I found this thread on the strapi forums and the solution there worked (merge the packages.json of a new strapi installation with mine).
I also wonder if the migration guides should use the ~ (eg "~4.15.5" instead of "4.15.5") to get the latest patch instead of the exact version. I did that and it went fine but there may be gotchas I don't know.
Do you also know why react became an explicit dependency ? It seems it's going to complicate future upgrades too.
Additional context
No response
Suggested improvements or fixes
Here is the naive upgrade of the dependencies:
"dependencies": {
"@strapi/strapi": "~4.25.22",
"@strapi/plugin-users-permissions": "~4.25.22",
"@strapi/plugin-i18n": "~4.25.22",
"pg": "^8.16.3",
"strapi-plugin-populate-deep": "^3.0.0"
},
Here is the correct one:
"dependencies": {
"@strapi/strapi": "~4.25.22",
"@strapi/plugin-users-permissions": "~4.25.22",
"@strapi/plugin-i18n": "~4.25.22",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "5.3.4",
"styled-components": "5.3.3",
"pg": "^8.16.3",
"strapi-plugin-populate-deep": "^3.0.0"
},
I'm also using postgres and a plugin but they are not part of the problem.
Related issue(s)/PR(s)
No response