Kotti Next的tinyfrontend前端生成和测试(使用WorkBuddy)

使用WorkBuddy生成tinyfrontend前端

测试:

复制代码
c:\Users\Admin\WorkBuddy\20260330150804\tinyfrontend>npm run test

测试通过

复制代码
c:\Users\Admin\WorkBuddy\20260330150804\tinyfrontend>npm run test

> kotti-next-tinyfrontend@0.1.0 test
> node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand

(node:40720) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
 PASS  tests/api/users.test.js
 PASS  tests/utils/helpers.test.js
 PASS  tests/stores/content.test.js
 PASS  tests/stores/ui.test.js
 PASS  tests/api/client.test.js
 PASS  tests/stores/auth.test.js
 PASS  tests/api/acl.test.js
 PASS  tests/api/nodes.test.js
 PASS  tests/api/auth.test.js
 PASS  tests/stores/base.test.js

Test Suites: 10 passed, 10 total
Tests:       144 passed, 144 total
Snapshots:   0 total
Time:        23.837 s
Ran all test suites.

运行

运行报错

c:\Users\Admin\WorkBuddy\20260330150804\tinyfrontend>npm run dev > kotti-next-tinyfrontend@0.1.0 dev > node scripts/dev.js Dev server: http://localhost:3000 X [ERROR] Could not resolve "../utils/hooks.js" src/views/content/DashboardView.js:4:25: 4 │ import { useStore } from '../utils/hooks.js' ╵ ~~~~~~~~~~~~~~~~~~~ X [ERROR] Could not resolve "../stores/content.js" src/views/content/DashboardView.js:5:41: 5 │ import contentStore, { fetchNodes } from '../stores/content.js' ╵ ~~~~~~~~~~~~~~~~~~~~~~ X [ERROR] Could not resolve "../stores/auth.js" src/views/content/DashboardView.js:6:22: 6 │ import authStore from '../stores/auth.js' ╵ ~~~~~~~~~~~~~~~~~~~ X [ERROR] Could not resolve "../router/index.js" src/views/content/DashboardView.js:7:25: 7 │ import { navigate } from '../router/index.js' ╵ ~~~~~~~~~~~~~~~~~~~~ X [ERROR] Could not resolve "../components/ui.js"

让WorkBuddy解决问题

帮我处理一下这个项目的报错问题。项目目录:c:\Users\Admin\WorkBuddy\20260330150804\

项目轻量前端目录:c:\Users\Admin\WorkBuddy\20260330150804\tinyfrontend

前端测试没有问题,但是启动后报错:c:\Users\Admin\WorkBuddy\20260330150804\tinyfrontend>npm run dev > kotti-next-tinyfrontend@0.1.0 dev > node scripts/dev.js Dev server: http://localhost:3000 X [ERROR] Could not resolve "../utils/hooks.js" src/views/content/DashboardView.js:4:25: 4 │ import { useStore } from '../utils/hooks.js' ╵ ~~~~~~~~~~~~~~~~~~~ X [ERROR] Could not resolve "../stores/content.js" src/views/content/DashboardView.js:5:41: 5 │ import contentStore, { fetchNodes } from '../stores/content.js' ╵ ~~~~~~~~~~~~~~~~~~~~~~ X [ERROR] Could not resolve "../stores/auth.js" src/views/content/DashboardView.js:6:22: 6 │ import authStore from '../stores/auth.js' ╵ ~~~~~~~~~~~~~~~~~~~ X [ERROR] Could not resolve "../router/index.js" src/views/content/DashboardView.js:7:25: 7 │ import { navigate } from '../router/index.js' ╵ ~~~~~~~~~~~~~~~~~~~~ X [ERROR] Could not resolve "../components/ui.js" src/views/content/DashboardView.js:8:55: 8 │ import { Card, Button, Tag, PageHeader, Spinner } from '../components/ui.js' ╵ ~~~~~~~~~~~~~~~~~~~~~ X [ERROR] Could not resolve "../utils/helpers.js" src/views/content/DashboardView.js:9:54: 9 │ import { formatRelative, stateText, stateClass } from '../utils/helpers.js'

应该是相对路径有问题,请解决。

WorkBuddy出500错误

复制代码
=== Error Report ===

--- User-Friendly Information ---
Message: <html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>openresty</center>
<p><em>Powered by <a href="https://apisix.apache.org/">APISIX</a>.</em></p></body>
</html>


--- Technical Details ---
Error Code: 500
Request ID: 935bb14a0c6d4c1d8c27e7cc1366e5fa
Trace ID: fcffcbd0f46716b97ad698e4cd346687
Timestamp: 2026/04/02 10:55:04 (UTC+8)

再次用新prompt

帮我处理一下这个项目的报错问题。项目目录:c:\Users\Admin\WorkBuddy\20260330150804\ 项目轻量前端目录:c:\Users\Admin\WorkBuddy\20260330150804\tinyfrontend 前端测试没有问题,但是启动后报错:c:\Users\Admin\WorkBuddy\20260330150804\tinyfrontend>npm run dev

可能是这样的路径引用有问题:import { useStore } from '../utils/hooks.js' import uiStore, { hideToast } from '../stores/ui.js'

请帮我使用别名路径,在项目配置中设置别名,可以简化路径引用

还是500报错

换用Trae解决问题

prompt如上

问题解决,前端首页出来啦!

但是Trae有个问题,就是首页登录这块它调了好多次没有调通。以前我让它写类似的程序,到了登录这里也是调了好久。这也是我为什么换用WorkBuddy来做Kotti Next的原因。

换回WorkBuddy来调登录问题

前期已经做了kotti next这个前后端分离的web框架。现在前端启动后,浏览器打开首页,使用默认用户名登录报错:Unauthorized image.png​

请查找问题并解决。

问题解决

相关推荐
PieroPc1 小时前
CAMWATCH — 局域网摄像头监控系统 Fastapi + html
前端·python·html·fastapi·监控
巴巴博一2 小时前
2026 最新:Trae / Cursor 一键接入 taste-skill 完整教程(让 AI 前端告别“AI 味”)
前端·ai·ai编程
kyriewen2 小时前
半夜三点线上崩了,AI替我背了锅——用AI排错,五分钟定位三年老bug
前端·javascript·ai编程
kyriewen3 小时前
我让 AI 当了 24 小时全年无休的“毒舌考官”
前端·ci/cd·ai编程
hexu_blog3 小时前
vue+java实现图片批量压缩
java·前端·vue.js
IT_陈寒3 小时前
为什么你应该学习JavaScript?
前端·人工智能·后端
lifejump3 小时前
Empire(帝国)CMS 7.5 XSS注入
前端·安全·xss
无风听海3 小时前
OAuth 2.0 前端通道与后端通道深入剖析
前端·oauth
sakiko_3 小时前
UIKit学习笔记8-发送照片、拍摄照片并发送
前端·swift·uikit
_code_bear_4 小时前
OpenSpec CLI 与 OPSX 工作流说明
前端·后端·架构