Skip to content

fix: isolate classic frontend install in Makefile to match Docker#5790

Open
feitianbubu wants to merge 1 commit into
QuantumNous:mainfrom
feitianbubu:fix/classic-frontend-isolated-install
Open

fix: isolate classic frontend install in Makefile to match Docker#5790
feitianbubu wants to merge 1 commit into
QuantumNous:mainfrom
feitianbubu:fix/classic-frontend-isolated-install

Conversation

@feitianbubu

@feitianbubu feitianbubu commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

📝 变更描述 / Description

本地用 make build-all-frontends 构建后,classic(旧版)主题的数据看板会白屏崩溃:Cannot read properties of undefined (reading 'createCanvas')

根因:web/ 是 bun workspace,classic 走全量 bun install 时,default 主题的 vrender-core@1.0.45(VChart 2.0)占住了顶层 hoist 位,把 classic 用的 vrender-core@0.17.17(VChart 1.8)挤成了多份嵌套副本。vrender-core 的 container/application 是模块级单例,多份副本会让 DI 容器分裂——浏览器环境注册到其中一份,渲染时却读到另一份的空 envContribution,于是 createCanvas 取到 undefined 报错。

Dockerfilebuilder-classic 阶段本来就用 bun install --filter ./classic(独立容器、只装 classic),所以官方 Docker 镜像不受影响。这个 PR 把 make build-frontend-classic 对齐成同样的隔离安装(构建前清掉 node_modules,再 --filter ./classic),让本地构建产物和 Docker 一致。

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix)

🔗 关联任务 / Related Issue

  • 无单独 Issue:这是本地 make 构建与 Docker 不一致导致的工具链问题,官方镜像无此现象。

✅ 提交前检查项 / Checklist

  • 人工确认
  • 非重复提交
  • Bug fix 说明:仅影响本地 make 构建,官方 Docker 镜像不受影响
  • 变更理解
  • 范围聚焦:仅改 makefile 一行
  • 本地验证

📸 运行证明 / Proof of Work

以 classic 构建产物里 vrender-core 的副本数衡量(看 chunk 内 getCommonCanvas 出现次数,单份=正常):

  • 修复前 make build-all-frontends:classic chunk getCommonCanvas = 10(多份分裂)→ 看板崩溃
  • 修复后:classic chunk getCommonCanvas = 2(单份,与 default 新版主题一致)→ 看板正常
image

Summary by CodeRabbit

  • Chores
    • Improved the classic frontend build process to start from a clean dependency state, helping avoid issues caused by leftover packages from previous installs.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The build-frontend-classic makefile target now runs rm -rf node_modules classic/node_modules before bun install, replacing the previous behavior that ran bun install directly without cleaning existing dependency directories.

Classic Frontend Build Cleanup

Layer / File(s) Summary
Delete node_modules before bun install
makefile
Prepends rm -rf node_modules classic/node_modules to the classic frontend bun install step.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • QuantumNous/new-api#5676: Also modifies the classic frontend bun install invocation in the build pipeline, scoping it to --filter ./classic.

Poem

🐇 Hop hop, sweep the old away,
node_modules must not stay!
Fresh install with every run,
Clean deps under the bun.
A tidy burrow, work is done! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the Makefile change to isolate the classic frontend install and align it with Docker.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant