cli: pocket compile --aot in a source checkout reports the missing pocketjs.wasm without naming the command that builds it

未关闭 适合新手
#724 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
85/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
bun, typescript, wasm
领域
cli

调研方向

打开 tools/aot-compile.ts 中第 128-129 行附近、抛出缺失 layout oracle 的位置,并与 site/microts/lib/kit.ts:53 中同一文件已经使用的措辞进行比较。用 --aot 编译命令在没有 platforms/web/pocketjs.wasm 的 checkout 中复现,然后改写错误信息,使其点名 bun tools/wasm.ts 以及 rustup target add wasm32-unknown-unknown 这一要求;如果修复改为构建该资源,则 tools/wasm.ts 导出了 ensureHostWasm()。完成意味着该消息告诉 checkout 用户如何生成该文件。

由索引模型根据 Issue 内容生成。

描述

enhancement

Version

PocketJS v0.17.0 (83c6cac9, current main), used as a git submodule. macOS 27.2 arm64, Bun 1.4.2.

Repro

In a fresh clone of the repository (no platforms/web/pocketjs.wasm; the file is in .gitignore), compile any aot: true application:

bun $POCKETJS/tools/pocket.ts compile --config pocket.host.config.ts --aot --out gen

Actual

✓ pocket.host.config.ts app
✓ repro-esp32s3 hosts the application
✓ TypeScript (62 app module(s))
✓ ResolvedBuildPlan sha256:…
PocketJS: AOT: prebuilt layout oracle not found: <pocketjs>/platforms/web/pocketjs.wasm; install/build the compiler's wasm asset before compilation

cli.md states that a missing oracle is an error but not how to produce it. The npm package ships the file (files whitelist; CI runs bun tools/wasm.ts before publishing, skills/pocketjs-release/SKILL.md), so the case arises in checkouts: a framework clone, or a product that pins PocketJS as a submodule and runs the CLI from it, as an ESP-IDF build does.

Expected

In a checkout the message names the command and its requirement, for example:

AOT: the layout oracle platforms/web/pocketjs.wasm is missing; build it with `bun tools/wasm.ts` (needs `rustup target add wasm32-unknown-unknown`)

site/microts/lib/kit.ts:53 already reports the same file this way. Alternatively the CLI builds it: tools/wasm.ts exports ensureHostWasm().

Cause

tools/aot-compile.ts:128–129.

Workaround

Run bun tools/wasm.ts in the PocketJS checkout before the first AOT compile.

主要语言
TypeScript
星标
1.6k
派生
88
PR 合并指标
30 天内没有已合并 PR

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pocket-stack/pocketjs 的其他 Issue

查看 pocket-stack/pocketjs 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。