Strapi v4 DigitalOcean deployment error :(

System Information
  • Strapi Version: 4.0.0-beta.22
  • Operating System: Windows and DigitalOcean
  • Database: mysql
  • Node Version: >=12.x.x <=16.x.x
  • NPM Version: >=6.0.0
  • Yarn Version: —

I tried deploying Strapi on DigitalOcean using the following guide:

But the deployment fails due to:

I tried changing the packges.json to use node up until the 14. version, but it’s the same. I also changed the build commands to both the following:
yarn build
and
NODE_ENV=production npm run build
(also changed the run command there).

But I am getting the following error in the deployment:
Building your admin UI with production configuration …
[strapi-falu-app] [2022-02-06 22:32:53] :information_source: Compiling Webpack
[strapi-falu-app] [2022-02-06 22:33:04] ModuleNotFoundError: Module not found: Error: Can’t resolve ‘@strapi/design-system/Carousel’ in ‘/workspace/node_modules/@strapi/plugin-upload/admin/src/components/MediaLibraryInput/Carousel’
[strapi-falu-app] [2022-02-06 22:33:04] at /workspace/node_modules/webpack/lib/Compilation.js:1765:28
[strapi-falu-app] [2022-02-06 22:33:04] at /workspace/node_modules/webpack/lib/NormalModuleFactory.js:730:13

and
[2022-02-06 21:45:52] Building your admin UI with production configuration …
[2022-02-06 21:45:54] :information_source: Compiling Webpack
[2022-02-06 21:45:56] ModuleNotFoundError: Module not found: Error: Can’t resolve ‘@strapi/design-system/themes’ in ‘/workspace/.cache/admin/src’
[2022-02-06 21:45:56] at /workspace/node_modules/webpack/lib/Compilation.js:1765:28
[2022-02-06 21:45:56] at /workspace/node_modules/webpack/lib/NormalModuleFactory.js:730:13

My config:

{
  "name": "xxxxx",
  "private": true,
  "version": "0.1.0",
  "description": "A Strapi application",
  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "strapi": "strapi"
  },
  "dependencies": {
    "@strapi/design-system": "^0.0.1-alpha.74",
    "@strapi/icons": "^0.0.1-alpha.74",
    "@strapi/plugin-i18n": "4.0.0-beta.22",
    "@strapi/plugin-users-permissions": "4.0.0-beta.22",
    "@strapi/strapi": "4.0.0-beta.22",
    "mysql": "2.18.1",
    "pg-connection-string": "^2.5.0"
  },
  "author": {
    "name": "A Strapi developer"
  },
  "strapi": {
    "uuid": "fee69702-c9a1-489b-9403-84adbb3ab49e"
  },
  "engines": {
    "node": ">=12.x.x <=16.x.x",
    "npm": ">=6.0.0"
  },
  "license": "MIT"
}

Any ideas? This is driving me crazy. :slight_smile: Thanks!


Did you found any solution? I’m facing a similiar problem :confused:

$ npm run gcp-build

> institutional-cms@0.4.2 gcp-build
> strapi build

Building your admin UI with development configuration...

● Webpack █████████████████████████ building (62%) 2/2 entries 2985/3106 dependencies 516/1465 modules 374 active
 node_modules\date-fns\differenceInWeeks\index.js

ModuleNotFoundError: Module not found: Error: Can't resolve '@strapi/icons/CarretDown' in 'C:\Users\xxx\www\xxx-cms\strapi\node_modules\@strapi\design-system\dist\Select'
Did you mean 'CarretDown.js'?
BREAKING CHANGE: The request '@strapi/icons/CarretDown' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.