v4.14.0 to v4.15.5 migration guide
The present migration guide upgrades Strapi v4.14.0 to v4.15.5. Strapi v4.15.5 updated the loading order of the middlewares, ensuring the logger
middleware is loaded first. The migration guide consists of:
- Upgrading the application dependencies
- Manually updating the loading order of middlewares in the configuration file
- Reinitializing the application
Plugins extension that create custom code or modify existing code, will need to be updated and compared to the changes in the repository. Not updating the plugin extensions could break the application.
Upgrading the application dependencies to 4.15.5
Stop the server before starting the upgrade.
Upgrade all of the Strapi packages in
package.json
to 4.15.5:path: package.json{
// ...
"dependencies": {
"@strapi/strapi": "4.15.5",
"@strapi/plugin-users-permissions": "4.15.5",
"@strapi/plugin-i18n": "4.15.5",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "5.3.4",
"styled-components": "5.3.3"
// ...
}
}Save the edited
package.json
file.Run the install command:
Install the upgraded version:
- yarn
- npm
yarn
npm install
💡 TipIf the operation doesn't work, try removing your
yarn.lock
orpackage-lock.json
. If that doesn't help, remove thenode_modules
folder as well and try again.
Manually update the loading order of middlewares
Manually update the config/middlewares.js
configuration file to ensure that strapi::logger
is the first item in the array:
- JavaScript
- TypeScript
module.exports = [
"strapi::logger",
"strapi::errors",
"strapi::security",
"strapi::cors",
// …
];
export default [
"strapi::logger",
"strapi::cors",
"strapi::body",
"strapi::errors",
// …
];
Rebuild the application
Run the following command in your project root directory to rebuild Strapi's admin panel:
- yarn
- npm
yarn build
npm run build
Restart the application
Run the following command in your project root directory to restart the application:
- yarn
- npm
yarn develop
npm run develop