Error when deploying on Heroku

I have an app working fine locally and was working fine on Heroku until I updated Strapi from 4.1.2 to 4.1.9 and made several updates locally to be pushed out to Heroku.

According to my deployment logs on Heroku, there are several dependency warnings but I’ve heard this is typical and not to be alarmed. When I updated Strapi it gave me similar dependency warnings.

The one thing I think has to do with it is the “NPM_CONFIG_LOGLEVEL=error” but I don’t what this means.

-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/nodejs
-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       USE_YARN_CACHE=true
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       
-----> Installing binaries
       engines.node (package.json):  <=16.x.x
       engines.npm (package.json):   <=6.x.x
       engines.yarn (package.json):  unspecified (use default)
       
       Resolving node version <=16.x.x...
       Downloading and installing node 16.15.0...
       Bootstrapping npm <=6.x.x (replacing 8.5.5)...
       npm 6.14.17 installed
       Resolving yarn version 1.22.x...
       Downloading and installing yarn (1.22.18)
       Installed yarn 1.22.18
       
-----> Restoring cache
       Cached directories were not restored due to a change in version of node, npm, yarn or stack
       Module installation may take longer for this build
       
-----> Installing dependencies
       Installing node modules (yarn.lock)
       yarn install v1.22.18
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       [3/4] Linking dependencies...
       warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.9" has unmet peer dependency "formik@^2.2.6".
       warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.9" has unmet peer dependency "immer@9.0.6".
       warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.9" has unmet peer dependency "qs@6.10.1".
       warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.9" has unmet peer dependency "react-select@^4.0.2".
       warning "@strapi/plugin-users-permissions > grant-koa@5.4.8" has unmet peer dependency "koa@>=2.0.0".
       warning "@strapi/plugin-users-permissions > react-redux@7.2.3" has unmet peer dependency "redux@^2.0.0 || ^3.0.0 || ^4.0.0-0".
       warning "@strapi/plugin-users-permissions > @strapi/helper-plugin > mini-css-extract-plugin@2.4.4" has unmet peer dependency "webpack@^5.0.0".
       warning "@strapi/plugin-users-permissions > @strapi/helper-plugin > styled-components@5.3.3" has unmet peer dependency "react-is@>= 16.8.0".
       warning "@strapi/strapi > @strapi/admin > @strapi/design-system@1.1.0" has incorrect peer dependency "@strapi/icons@^0.0.1-alpha.73".
       warning "@strapi/strapi > @strapi/admin > react-virtualized@9.22.3" has incorrect peer dependency "react@^15.3.0 || ^16.0.0-alpha".
       warning "@strapi/strapi > @strapi/admin > react-virtualized@9.22.3" has incorrect peer dependency "react-dom@^15.3.0 || ^16.0.0-alpha".
       warning Workspaces can only be enabled in private projects.
       warning Workspaces can only be enabled in private projects.
       [4/4] Building fresh packages...
       Done in 46.64s.
       
-----> Build
       Running build (yarn)
       yarn run v1.22.18
       $ strapi build
       Building your admin UI with production configuration ...
       ℹ Compiling Webpack
       ✔ Webpack: Compiled successfully in 17.58s
       Admin UI built successfully
       Done in 21.19s.
       
-----> Pruning devDependencies
       yarn install v1.22.18
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       [3/4] Linking dependencies...
       warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.9" has unmet peer dependency "formik@^2.2.6".
       warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.9" has unmet peer dependency "immer@9.0.6".
       warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.9" has unmet peer dependency "qs@6.10.1".
       warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.9" has unmet peer dependency "react-select@^4.0.2".
       warning "@strapi/plugin-users-permissions > grant-koa@5.4.8" has unmet peer dependency "koa@>=2.0.0".
       warning "@strapi/plugin-users-permissions > react-redux@7.2.3" has unmet peer dependency "redux@^2.0.0 || ^3.0.0 || ^4.0.0-0".
       warning "@strapi/plugin-users-permissions > @strapi/helper-plugin > mini-css-extract-plugin@2.4.4" has unmet peer dependency "webpack@^5.0.0".
       warning "@strapi/plugin-users-permissions > @strapi/helper-plugin > styled-components@5.3.3" has unmet peer dependency "react-is@>= 16.8.0".
       warning "@strapi/strapi > @strapi/admin > @strapi/design-system@1.1.0" has incorrect peer dependency "@strapi/icons@^0.0.1-alpha.73".
       warning "@strapi/strapi > @strapi/admin > react-virtualized@9.22.3" has incorrect peer dependency "react@^15.3.0 || ^16.0.0-alpha".
       warning "@strapi/strapi > @strapi/admin > react-virtualized@9.22.3" has incorrect peer dependency "react-dom@^15.3.0 || ^16.0.0-alpha".
       warning Workspaces can only be enabled in private projects.
       warning Workspaces can only be enabled in private projects.
       [4/4] Building fresh packages...
       warning Ignored scripts due to flag.
       Done in 6.05s.
       
-----> Caching build
       - yarn cache
       
-----> Build succeeded!
 !     Unmet dependencies don't fail yarn install but may cause runtime issues
       https://github.com/npm/npm/issues/7494
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for buildpack -> web
-----> Compressing...
       Done: 123.8M
-----> Launching...
       Released v16
       https://myapp.herokuapp.com/ deployed to Heroku
1 Like

Following the migration steps to 4.1.8 seemed to get the production server working. So I’m considering this issue resolved but I’d really like to understand how to resolve the errors / warnings I’m still getting in the build logs.
https://docs.strapi.io/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.0.6±to-4.1.8.html

As you mentioned these can be safely ignored. In many cases we (as in Strapi) didn’t define peer dependencies for various reasons. Given how old Strapi is we have several legacy packages and nested under several layers are simply older packages. Many newer ones install newer versions of these which get used by our older packages.

This is extremely common in node ecosystems and fixing it simply isn’t worth our time at the moment since they cause no errors (or when they do, we fix them). As you can imagine our team has higher priorities at the moment such as bug fixes that actually impact users and developing new features. Possibly when things slow down (or even just as we iterate on features and packages) these warnings will slowly fade away but for now they cause no problems and thus are not a concern.

Note that it’s practically impossible to clean these up from the project level and requires the “fixes” to be done on our Strapi packages.

1 Like

Uh, oh. That’s a 404