Files
Genarrative/docs/technical/NODE_DEV_STARTUP_HOTFIX_2026-04-20.md
2026-04-20 05:14:50 +00:00

41 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Node Dev 启动热修记录 2026-04-20
## 背景
2026-04-20 执行 `npm run dev`Node 后端在加载 `server-node/src/modules/story/storyActionService.ts` 过程中报错:
- `TransformError`
- `Unterminated string literal`
- 触发行位于 `storyActionService.ts:17`
该问题会导致前端 Vite 服务启动成功,但 `server-node` 无法完成编译和监听,开发态故事运行链路不可用。
## 根因
`storyActionService.ts` 中导入库存剧情动作服务的语句被意外拆断,形成了非法字符串字面量:
- 路径在 `../inventory/inventory` 后被换行截断
- 真实目标文件名 `inventoryStoryActionService.js` 没有完整写入
这属于单点语法错误,不涉及运行时逻辑回归。
## 修复
本次只做最小代码补丁:
- 将导入恢复为 `../inventory/inventoryStoryActionService.js`
- 保持原文件其余中文文案、剧情文本与结构不动
## 验证
修复后已完成以下验证:
- `npm run dev``server-node` 于 2026-04-20 03:51:24 UTC 成功启动,日志显示监听 `:8081`
- `npm run check:encoding`:通过,`1641` 个文件编码检查正常
- `npm run server-node:build`:通过
## 后续约束
- 继续对包含中文文本的运行时故事文件采用局部补丁,避免整文件重写
- 再次调整 `storyActionService.ts` 或相邻剧情服务时,优先补跑编码检查与后端构建