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​

请查找问题并解决。

问题解决

相关推荐
爱勇宝4 分钟前
从前端到全栈,我最后学会的是:先做产品
前端·后端
console.log('npc')8 分钟前
Grill-Me 技能使用教程
前端·大模型·产品·skill·需求
真空回流焊炉20 分钟前
数字功率芯片真空共晶设备实操教程与要点解析
前端·人工智能
mayaairi28 分钟前
JS DOM属性操作完全指南:内容、样式与自定义属性
开发语言·前端·javascript
avi911132 分钟前
Threejs新版本后glb导出提示.x问题GLTFExporter,替代3dmax
开发语言·前端·javascript·threejs·glb·gltfexporter
treesforest1 小时前
前端表单提效实践:基于IP地理位置实现国家区号智能预填
前端·网络协议·tcp/ip·ip定位·ip属地
用户298698530141 小时前
React 中 Word 文档转图片的实践方案
前端·javascript·react.js
Csvn1 小时前
异步并发控制:手写并发池、竞态防护与取消的完整方案
前端·javascript
专业抄代码选手1 小时前
06|双缓冲与 Commit:让 Fiber 支持第二次渲染
前端·javascript·react.js
涛涛ing1 小时前
4.8K Star!一套规则让 AI 帮你写出“像人写的”前端代码
前端