@lark-apaas/coding-steering 0.1.6-alpha.10 → 0.1.6-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-fix
|
|
3
|
-
description: Use when encountering code errors such as import failures, TypeScript/Dto type mismatches, JSX syntax issues, API call exceptions, route 404 errors, or **lucide-react icon not found / duplicate identifier / barrel-export naming conflicts**. 触发词:导入错误, 模块解析失败, 类型错误, Dto不匹配, JSX语法, API异常, 路由404, code fix, debugging, lucide-react import error, icon not found, 图标不存在, Cannot find name, 标识符重复, no-redeclare, export 冲突, 桶导出冲突, dual export, "请修复错误"
|
|
3
|
+
description: Use when encountering code errors such as import failures, TypeScript/Dto type mismatches, JSX syntax issues, API call exceptions, route 404 errors, PostgresError connection verification failed, or **lucide-react icon not found / duplicate identifier / barrel-export naming conflicts**. 触发词:导入错误, 模块解析失败, 类型错误, Dto不匹配, JSX语法, API异常, 路由404, code fix, debugging, lucide-react import error, icon not found, 图标不存在, Cannot find name, 标识符重复, no-redeclare, export 冲突, 桶导出冲突, dual export, "请修复错误" 通用排错, please re-obtain a valid database connection
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
|
|
@@ -200,6 +200,27 @@ try {
|
|
|
200
200
|
|
|
201
201
|
注意:优先让错误信息中包含堆栈信息,以更精确的定位错误发生位置。
|
|
202
202
|
|
|
203
|
+
## 数据库连接问题
|
|
204
|
+
|
|
205
|
+
### PG 连接串过期 / 失效
|
|
206
|
+
|
|
207
|
+
**问题描述**:`npm run dev` 启动后,后端访问数据库时报类似如下错误(关键特征是 `connection verification failed` + `expired or invalid connection link`,endpoint 域名以实际为准):
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
PostgresError: connection verification failed for endpoint "<pg-endpoint>": expired or invalid connection link, please re-obtain a valid database connection
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**根因**:PG connection string 注入在 `.env.local` 中,由于安全策略,连接串 **5 天过期**。`npm run dev` 启动时只会读取一次 `.env.local`,过期后旧连接串就会触发上述报错。
|
|
214
|
+
|
|
215
|
+
**修复方案**:**重新运行 `npm run dev`** 即可。启动脚本会重新拉取并注入最新的 PG connection string 到 `.env.local`,新进程读取到的就是有效连接串。不要去改后端代码或 ORM 配置。
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
**注意**:
|
|
219
|
+
|
|
220
|
+
- 不要尝试手工编辑 `.env.local` 里的 PG connection string,连接串由启动流程统一管理
|
|
221
|
+
- 不要把这个错误当成业务代码 bug 去排查 controller / service / 数据库 schema
|
|
222
|
+
- 重启 `npm run dev` 后若仍报同样错误,再按其它通用排查路径处理
|
|
223
|
+
|
|
203
224
|
## 路由和导航问题
|
|
204
225
|
|
|
205
226
|
### 路由 404 错误诊断
|