betrueagency / nx-reactjs-elementor

29 stars 9 forks source link

nx pkg fails with my-workspace/apps/my-project not found exception #10

Closed aczire closed 2 years ago

aczire commented 2 years ago

nx pkg fails with below exception. Seems its still looking at the apps directory instead of packages directory to find the source during the package phase.

Seems some change is required here, https://github.com/betrueagency/nx-reactjs-elementor/blob/8eb67b98bde8247bb325f3c55fbb412133cc37f8/packages/react-elementor/src/executors/build/executor.ts#L29

await copySync(${context.root}/apps/${options.plugin}, ${context.root}/dist/elementor/${options.plugin}) await copySync(${context.root}/dist/apps/${options.plugin}, ${context.root}/dist/elementor/${options.plugin}/dist)

$ npx nx pkg my-project --verbose

nx run my-project:pkg

@nrwl/workspace:run-commands is deprecated and will be removed in Nx 16. Please switch to nx:run-commands

nx run my-project:build:production [existing outputs match the cache, left as is] Entrypoint main [big] 335 KiB = runtime.esm.js 1.63 KiB main.esm.js 334 KiB Entrypoint polyfills 93.9 KiB = runtime.esm.js 1.63 KiB polyfills.esm.js 92.3 KiB chunk (runtime: runtime) main.esm.js (main) 970 KiB [initial] [rendered] chunk (runtime: runtime) polyfills.esm.js (polyfills) 301 KiB [initial] [rendered] chunk (runtime: runtime) runtime.esm.js (runtime) 4.4 KiB [entry] [rendered] webpack compiled successfully (e5e3e56a0158a44b)

NX Successfully ran target build for project my-project Nx read the output from the cache instead of running the command for 1 out of 1 tasks. nx run my-project:plugin NX ENOENT: no such file or directory, lstat 'C:\dev\wp-dev\nx-create\my-workspace/apps/my-project' Error: ENOENT: no such file or directory, lstat 'C:\dev\wp-dev\nx-create\my-workspace/apps/my-project' at Object.lstatSync (node:fs:1514:3) at Object.lstatSync (C:\dev\wp-dev\nx-create\my-workspace\node_modules\graceful-fs\polyfills.js:318:34) at statFunc (C:\dev\wp-dev\nx-create\my-workspace\node_modules\fs-extra\lib\util\stat.js:24:20) at getStatsSync (C:\dev\wp-dev\nx-create\my-workspace\node_modules\fs-extra\lib\util\stat.js:25:19) at Object.checkPathsSync (C:\dev\wp-dev\nx-create\my-workspace\node_modules\fs-extra\lib\util\stat.js:67:33) at copySync (C:\dev\wp-dev\nx-create\my-workspace\node_modules\fs-extra\lib\copy\copy-sync.js:27:38) at C:\dev\wp-dev\nx-create\my-workspace\node_modules\@betrue\react-elementor\src\executors\build\executor.js:29:39 at Generator.next () at C:\dev\wp-dev\nx-create\my-workspace\node_modules\tslib\tslib.js:118:75 at new Promise ()

NX Running target "my-project:plugin" failed Failed tasks:

my-project:plugin Hint: run the command with --verbose for more details. Error: Command failed: nx plugin my-project at checkExecSyncError (node:child_process:826:11) at execSync (node:child_process:900:15) at createSyncProcess (C:\dev\wp-dev\nx-create\my-workspace\node_modules\nx\src\executors\run-commands\run-commands.impl.js:166:34) at C:\dev\wp-dev\nx-create\my-workspace\node_modules\nx\src\executors\run-commands\run-commands.impl.js:113:13 at Generator.next () at C:\dev\wp-dev\nx-create\my-workspace\node_modules\tslib\tslib.js:118:75 at new Promise () at Object.__awaiter (C:\dev\wp-dev\nx-create\my-workspace\node_modules\tslib\tslib.js:114:16) at runSerially (C:\dev\wp-dev\nx-create\my-workspace\node_modules\nx\src\executors\run-commands\run-commands.impl.js:111:20) at C:\dev\wp-dev\nx-create\my-workspace\node_modules\nx\src\executors\run-commands\run-commands.impl.js:52:25 { status: 1, signal: null, output: [ null, null, null ], pid: 24780, stdout: null, stderr: null }

NX ERROR: Something went wrong in run-commands - Command failed: nx plugin my-project Error: ERROR: Something went wrong in run-commands - Command failed: nx plugin my-project at C:\dev\wp-dev\nx-create\my-workspace\node_modules\nx\src\executors\run-commands\run-commands.impl.js:59:19 at Generator.throw () at rejected (C:\dev\wp-dev\nx-create\my-workspace\node_modules\tslib\tslib.js:116:69) at processTicksAndRejections (node:internal/process/task_queues:96:5)

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

NX Running target "my-project:pkg" failed

Failed tasks:

alizarion commented 2 years ago

hi @aczire it seems that create-nx-workspace with the ts option no longer generates apps directory, can you try creating a workspace using these options

✔ Choose your style · integrated ✔ What to create in the new workspace · apps ✔ Enable distributed caching to make your CI faster · No

i have to fix the documentation