Skip to content

[Bug]: 无法编译 #151

@PeiJingbobo

Description

@PeiJingbobo

Bug type

Regression (worked before, now fails)

Summary

node v25.8.2
pnpm 10.23.0

编译时缺少模块

pei@MiWiFi-R4A-srv:~/openclaw-zero-token$ pnpm build

> openclaw@2026.3.11 build /home/pei/openclaw-zero-token
> pnpm canvas:a2ui:bundle && node scripts/tsdown-build.mjs && node scripts/copy-plugin-sdk-root-alias.mjs && pnpm build:plugin-sdk:dts && node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/copy-export-html-templates.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-startup-metadata.ts && node --import tsx scripts/write-cli-compat.ts


> openclaw@2026.3.11 canvas:a2ui:bundle /home/pei/openclaw-zero-token
> bash scripts/bundle-a2ui.sh

<DIR>/a2ui.bundle.js  chunk │ size: 457.10 kB                                 
                                                                              
✔ rolldown v1.0.0-rc.9 Finished in 146.38 ms                                 

 ERROR  Error: Build failed with 4 errors:

[UNRESOLVED_IMPORT] Error: Could not resolve '../auto-reply/thinking.shared.js' in src/agents/model-selection.ts
   ╭─[ src/agents/model-selection.ts:1:48 ]
   │
 1 │ import { resolveThinkingDefaultForModel } from "../auto-reply/thinking.shared.js";
   │                                                ─────────────────┬────────────────  
   │                                                                 ╰────────────────── Module not found.
   │ 
   │ Help: 'src/agents/model-selection.ts' is imported by the following path:
   │         - src/agents/model-selection.ts
   │         - src/config/defaults.ts
   │         - src/config/validation.ts
   │         - src/config/config.ts
   │         - src/cli/daemon-cli/install.ts
   │         - src/cli/daemon-cli/runners.ts
   │         - src/cli/daemon-cli.ts
───╯

[UNRESOLVED_IMPORT] Error: Could not resolve '../plugins/cli-backends.runtime.js' in src/agents/model-selection.ts
   ╭─[ src/agents/model-selection.ts:9:43 ]
   │
 9 │ import { resolveRuntimeCliBackends } from "../plugins/cli-backends.runtime.js";
   │                                           ──────────────────┬─────────────────  
   │                                                             ╰─────────────────── Module not found.
   │ 
   │ Help: 'src/agents/model-selection.ts' is imported by the following path:
   │         - src/agents/model-selection.ts
   │         - src/config/defaults.ts
   │         - src/config/validation.ts
   │         - src/config/config.ts
   │         - src/cli/daemon-cli/install.ts
   │         - src/cli/daemon-cli/runners.ts
   │         - src/cli/daemon-cli.ts
───╯

[UNRESOLVED_IMPORT] Error: Could not resolve './configured-provider-fallback.js' in src/agents/model-selection.ts
    ╭─[ src/agents/model-selection.ts:17:51 ]
    │
 17 │ import { resolveConfiguredProviderFallback } from "./configured-provider-fallback.js";
    │                                                   ─────────────────┬─────────────────  
    │                                                                    ╰─────────────────── Module not found.
    │ 
    │ Help: 'src/agents/model-selection.ts' is imported by the following path:
    │         - src/agents/model-selection.ts
    │         - src/config/defaults.ts
    │         - src/config/validation.ts
    │         - src/config/config.ts
    │         - src/cli/daemon-cli/install.ts
    │         - src/cli/daemon-cli/runners.ts
    │         - src/cli/daemon-cli.ts
────╯

[UNRESOLVED_IMPORT] Error: Could not resolve './provider-id.js' in src/agents/model-selection.ts
    ╭─[ src/agents/model-selection.ts:26:8 ]
    │
 26 │ } from "./provider-id.js";
    │        ─────────┬────────  
    │                 ╰────────── Module not found.
    │ 
    │ Help: 'src/agents/model-selection.ts' is imported by the following path:
    │         - src/agents/model-selection.ts
    │         - src/config/defaults.ts
    │         - src/config/validation.ts
    │         - src/config/config.ts
    │         - src/cli/daemon-cli/install.ts
    │         - src/cli/daemon-cli/runners.ts
    │         - src/cli/daemon-cli.ts
────╯

    at aggregateBindingErrorsIntoJsError (file:///home/pei/openclaw-zero-token/node_modules/.pnpm/rolldown@1.0.0-rc.9/node_modules/rolldown/dist/shared/error-CP8smW_P.mjs:48:18)
    at unwrapBindingResult (file:///home/pei/openclaw-zero-token/node_modules/.pnpm/rolldown@1.0.0-rc.9/node_modules/rolldown/dist/shared/error-CP8smW_P.mjs:18:128)
    at #build (file:///home/pei/openclaw-zero-token/node_modules/.pnpm/rolldown@1.0.0-rc.9/node_modules/rolldown/dist/shared/rolldown-build-4YnQkA76.mjs:3311:34)
    at async build (file:///home/pei/openclaw-zero-token/node_modules/.pnpm/rolldown@1.0.0-rc.9/node_modules/rolldown/dist/index.mjs:46:22)
    at async Promise.all (index 0)
    at async buildSingle (file:///home/pei/openclaw-zero-token/node_modules/.pnpm/tsdown@0.21.2_@typescript+native-preview@7.0.0-dev.20260311.1_typescript@5.9.3/node_modules/tsdown/dist/build-CpOl_krN.mjs:744:19)
    at async Promise.all (index 2)
    at async buildWithConfigs (file:///home/pei/openclaw-zero-token/node_modules/.pnpm/tsdown@0.21.2_@typescript+native-preview@7.0.0-dev.20260311.1_typescript@5.9.3/node_modules/tsdown/dist/build-CpOl_krN.mjs:700:18)
    at async CAC.<anonymous> (file:///home/pei/openclaw-zero-token/node_modules/.pnpm/tsdown@0.21.2_@typescript+native-preview@7.0.0-dev.20260311.1_typescript@5.9.3/node_modules/tsdown/dist/run.mjs:25:2)
    at async runCLI (file:///home/pei/openclaw-zero-token/node_modules/.pnpm/tsdown@0.21.2_@typescript+native-preview@7.0.0-dev.20260311.1_typescript@5.9.3/node_modules/tsdown/dist/run.mjs:49:3)

 ELIFECYCLE  Command failed with exit code 1.

Steps to reproduce

直接克隆项目然后编译

Expected behavior

能够成功编译

Actual behavior

无法编译 缺少模块

OpenClaw version

3月30日git最新代码

Operating system

debian 13 x86

Install method

No response

Model

未编译运行

Provider / routing chain

未编译运行

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions