flomesh-io / ztm

ZTM (Zero Trust Mesh) is privacy first, open source, decentralized network software, based on HTTP/2 tunnel. Boundless connectivity. Mesh the world!
Apache License 2.0
266 stars 21 forks source link

Argument Error in forkJoin function when running pipy agent/main.js in Windows #12

Closed genedna closed 1 month ago

genedna commented 1 month ago

When executing the command pipy agent/main.js, an error occurs within the forkJoin function in the /mesh.js file. The error message indicates that the first argument to forkJoin should be either an array or a function, but the current implementation does not meet this requirement.

C:\Users\meagl\GitMono\ztm>pipy agent/main.js
2024-06-01 11:18:15.784 [ERR] [pjs] File /mesh.js:
2024-06-01 11:18:15.785 [ERR] [pjs] Line 163:  .forkJoin().to($=>$
2024-06-01 11:18:15.785 [ERR] [pjs]                     ^
2024-06-01 11:18:15.785 [ERR] [pjs] Error: argument #1 expects an array or a function
2024-06-01 11:18:15.785 [ERR] [pjs] Backtrace:
2024-06-01 11:18:15.785 [ERR]     In forkJoin
2024-06-01 11:18:15.785 [ERR]     In (anonymous function at line 162 column 67) at line 163 column 18 in /mesh.js
2024-06-01 11:18:15.785 [ERR]     In to
2024-06-01 11:18:15.785 [ERR]     In (anonymous function at line 160 column 14) at line 162 column 66 in /mesh.js
2024-06-01 11:18:15.786 [ERR]     In class pipy::PipelineLayoutWrapper::Constructor
2024-06-01 11:18:15.786 [ERR]     In (anonymous function at line 82 column 3) at line 160 column 13 in /mesh.js
2024-06-01 11:18:15.786 [ERR]     In (anonymous function at line 531 column 5) at line 531 column 16 in /mesh.js
2024-06-01 11:18:15.786 [ERR]     In map
2024-06-01 11:18:15.786 [ERR]     In (anonymous function at line 3 column 16) at line 530 column 35 in /mesh.js
2024-06-01 11:18:15.786 [ERR]     In (anonymous function at line 25 column 5) at line 26 column 31 in /api.js
2024-06-01 11:18:15.786 [ERR]     In forEach
2024-06-01 11:18:15.786 [ERR]     In (anonymous function at line 23 column 1) at line 24 column 25 in /api.js
2024-06-01 11:18:15.786 [ERR]     In (root) at line 37 column 9 in \main.js
  1. Host Environment - Windows 11
  2. Pipy Version:
    C:\Users\meagl\GitMono\ztm>pipy -v
    Version     :
    Commit      : c0e16c1983b7dd8b510a8ea002118959cf7dea7b
    Commit Date : Thu, 25 Apr 2024 15:53:15 +0800
    Host        : Windows-10.0.17763 AMD64
    OpenSSL     : OpenSSL 3.2.0 23 Nov 2023
    Builtin GUI : Yes
    Samples     : Yes
  3. ZTM Version: commit ff35ff5cb0e2063f59b2623efc1392bd2f6b03dc
keveinliu commented 1 month ago

Hi, Your pipy version is not supported by ZTM. The oldest version pipy which is supported is 9fed128. You may refer to the pipy submodule of ZTM. Cheers, Kevein

genedna commented 1 month ago

@keveinliu ,

I built the ztm and followed the build instructions; I got an error message like the one below.

!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 5.32s
warning: unused manifest key: target.cfg(any(target_os = "android")).linker
   Compiling tauri-runtime-wry v2.0.0-beta.16
   Compiling ztm v0.0.4 (D:\GitMono\ztm\gui\src-tauri)
error: failed to run custom build command for `ztm v0.0.4 (D:\GitMono\ztm\gui\src-tauri)`

Caused by:
  process didn't exit successfully: `D:\GitMono\ztm\gui\src-tauri\target\release\build\ztm-3761a6cf831e6917\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=TAURI_CONFIG
  cargo:rerun-if-changed=tauri.conf.json
  cargo:rustc-cfg=desktop
  cargo:rustc-env=TAURI_ANDROID_PACKAGE_PREFIX=com_flomesh
  cargo:PERMISSION_FILES_PATH=D:\GitMono\ztm\gui\src-tauri\target\release\build\ztm-04b326dac161f89c\out\app-manifest\__app__-permission-files
  cargo:rerun-if-changed=capabilities
  cargo:rustc-env=TAURI_ENV_TARGET_TRIPLE=x86_64-pc-windows-msvc
  path matching bin/cli-x86_64-pc-windows-msvc.exe not found.
warning: build failed, waiting for other jobs to finish...
    Error failed to build app: failed to build app
genedna commented 1 month ago

@keveinliu ,

But I still completed the compile process and got a runnable execute file for running a zmt agent.

pajama-coder commented 1 month ago

@genedna It was caused by an extra 'tauri build' step that was accidentally added into the normal CLI build process. It is supposed to be corrected now in the latest commit. Please try it out.

genedna commented 1 month ago

@pajama-coder Yeah, the tauri build error is gone. When the compile process is completed, everything works.