Skip to content

Fixed macstats loading on Mac OS in the UI#851

Open
kinnrai wants to merge 1 commit into
ostris:mainfrom
kinnrai:fix/macstats-loading-on-mac
Open

Fixed macstats loading on Mac OS in the UI#851
kinnrai wants to merge 1 commit into
ostris:mainfrom
kinnrai:fix/macstats-loading-on-mac

Conversation

@kinnrai

@kinnrai kinnrai commented May 29, 2026

Copy link
Copy Markdown

Description

Fixes an issue on Mac OS where the macstats module could fail to load, causing the GPU monitor panel to show all zero values.

The issue was caused by loading macstats through createRequire() in the Next.js server routes. During the Next.js build, this created a broken runtime module resolution path for the ESM module, so the built route could still throw Cannot find module 'macstats' even when macstats was installed correctly.

This changes the Mac CPU and GPU API routes to load macstats through a shared dynamic import helper instead.

Closes #790.

@kinnrai kinnrai force-pushed the fix/macstats-loading-on-mac branch from 9d86267 to adb08ca Compare May 29, 2026 19:39
@jds-amplify

Copy link
Copy Markdown

I tried this and it seems to work. Will it be merged?

@FritzTheCatfish

Copy link
Copy Markdown

It would be great when it will be merged. By the way what macstats do you install? I installed the jkuri repository but after seeing no results I left it there.

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.

Mac 上 macstats 模块加载失败,GPU 监控面板数据全部显示 0,原因是 Next.js 构建时不支持用 createRequire 加载 ESM 模块。

3 participants