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​

请查找问题并解决。

问题解决

相关推荐
mCell3 小时前
用 Knip 清理 AI Coding 留下的冗余代码
前端·ai编程·前端工程化
笃行3504 小时前
使用Rokid AIUI做了一个童年推箱子游戏
前端
excel5 小时前
前端加密的作用与使用场景
前端
计算机魔术师6 小时前
纽约时报版权诉讼披露:微软高管内部称训练 AI 是人类历史上最大规模劳动窃取
前端
去伪存真7 小时前
大模型的参数量为什么那么大?
前端·人工智能
IT_陈寒7 小时前
Java空指针这次真把我坑惨了
前端·人工智能·后端
八荒启·交互动画8 小时前
# Web特效020—让 Web 特效真正动起来:时间循环应该怎么接
前端·webgl·网页特效·八荒启-交互动画·八荒启
动恰客流统计8 小时前
线下零售数字化浪潮下,客流统计的3个核心发展趋势
大数据·前端·人工智能
用户938515635079 小时前
从小米前端面试题,彻底搞懂闭包、作用域链与 useState 惰性初始化
前端·面试
粥里有勺糖9 小时前
视野修炼第133期 | Native 回春了?
前端·github·agent