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​

请查找问题并解决。

问题解决

相关推荐
学网安的肆伍8 小时前
【046-WEB攻防篇】注入工具&SQLMAP&Tamper编写&指纹修改&高权限操作&目录架构
前端·架构
Highcharts.js9 小时前
如何下载使用Highcharts Grid 开发web可编辑表格
前端·人工智能·grid 表格·web 表格·在线编辑表格·highcharts表格安装·表格开发工具
用户62960593247059 小时前
从“浏览器根本区分不了”到真正实现:刷新不退出,关闭标签页自动退出,前端判断浏览器关闭和刷新
前端
qetfw9 小时前
MWU:Vue 3 + FastAPI 的 MaaFramework 跨平台 WebUI 源码
前端·vue.js·python·fastapi·开源项目·效率工具
mfxcyh9 小时前
Vue3+Ant Design Vue 实现手动异步文件上传(含大小校验、弹窗上传)
前端·javascript·vue.js
wordbaby9 小时前
Web端热敏标签打印完整解决方案(QZ Tray + 译维A42)
前端
swipe9 小时前
03|Axios 请求进了后端之后:Controller、Request、Response 是怎么接住它的?
前端·后端·全栈
meilindehuzi_a10 小时前
Vue3进阶基础:指令修饰符、v-model表单绑定、动态样式、计算属性与侦听器实战
前端·javascript·vue.js
csdn2015_10 小时前
vue 前端运行命令
前端·javascript·vue.js
swipe10 小时前
02|从 `pnpm dev` 到 Spring Boot 启动:后端服务到底怎么跑起来?
前端·后端·全栈