TriPSs / nx-extend

Nx Workspaces builders and tools
MIT License
154 stars 40 forks source link

Strapi build issue with @nx-extend/strapi #302

Closed fallingforest closed 3 weeks ago

fallingforest commented 3 weeks ago

I got the issue when building Strapi with @nx-extend/strapi

 ⠋ Building admin panel
⠼ Building admin panelModule not found: Error: Can't resolve './.strapi/client/app.js' in '/home/my-monorepo'
✖ Building admin panel

 NX   Unknown error caught

I can run yarn build in the strapi folder without issue but when running with nx, it happened.

This is my build target:

    "build": {
          "executor": "@nx-extend/strapi:build",
          "options": {
            "production": true,
            "tsConfig": "apps/platform-api/tsconfig.json",
            "outputPath": "dist/apps/platform-api",
            "root": "apps/platform-api",
            "generateLockFile": true
          }
        }
TriPSs commented 3 weeks ago

Can you run nx report? Also the Strapi version installed locally should match the Strapi version of the package.

fallingforest commented 3 weeks ago

@TriPSs This is the output of the nx report, and the Strapi version was 4.25.4

Report complete - copy this into the issue template

Node           : 20.16.0
OS             : linux-x64
Native Target  : x86_64-linux
yarn           : 1.22.22

nx (global)        : 19.5.6
nx                 : 19.5.7
@nx/js             : 19.5.7
@nx/jest           : 19.5.7
@nx/linter         : 19.5.7
@nx/eslint         : 19.5.7
@nx/workspace      : 19.5.7
@nx/cypress        : 19.5.7
@nx/devkit         : 19.5.7
@nx/eslint-plugin  : 19.5.7
@nx/nest           : 19.5.7
@nx/next           : 19.5.7
@nx/node           : 19.5.7
@nx/react          : 19.5.7
@nx/storybook      : 19.5.7
@nrwl/tao          : 19.5.7
@nx/vite           : 19.5.7
@nx/web            : 19.5.7
@nx/webpack        : 19.5.7
typescript         : 5.5.4
---------------------------------------
Community plugins:
@nx-extend/strapi                : 11.0.0
@nx-tools/nx-container           : 5.3.1
@trumbitta/nx-plugin-unused-deps : 1.12.1
TriPSs commented 3 weeks ago

Could you create a repo that has this issue?

fallingforest commented 3 weeks ago

After created the new monorepo with @nx-extend/strapi. I found the problem was missing the webpack.config.js in the /src/admin directory of strapi project.