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​

请查找问题并解决。

问题解决

相关推荐
happymaker06262 小时前
请求头 & 文件下载 & JSP 内置对象实战
java·前端·servlet
m0_647057962 小时前
【无标题】
前端·人工智能
北城笑笑2 小时前
Frontend 与 FPGA 深度融合实战解析:从技术协同到多场景落地( 前端和现场可编程门阵列 )
前端·websocket·3d·vue·fpga
前端 贾公子2 小时前
把 Antigravity 用成一个更像 VS Code 的 AI IDE
前端
木斯佳2 小时前
前端八股文面经大全:腾讯PCG暑期前端一面(2026-04-01)·面经深度解析
前端·算法·面经·计算机原理
freewlt2 小时前
前端性能优化实战指南:从 3s 到 0.5s 的加载提速之路
前端·性能优化
qq_429499572 小时前
从LVGL标签读取数据转为变量
前端·javascript·vue.js
freewlt2 小时前
Vue3 + TypeScript 项目架构设计:从 0 搭建企业级前端工程
前端·javascript·typescript
happymaker06263 小时前
vue的声明周期、钩子函数、工程化开发
前端·javascript·vue.js