SonicJS部署问题:D1绑定调整后注册遇ECONNRESET错误求助
问题详情
- 创建Cloudflare D1数据库时执行命令:
得到的绑定名称为npx wrangler d1 create sonicjsDB。 - 运行
npm run dev时触发错误:Cannot read properties of undefined (reading 'prepare') - 将绑定名称改为
D1后,项目可正常启动,但提交注册信息时出现新错误,日志如下:The World's Fastest API Framework! [javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`. isAdminAccountCreated register false 10:14:42 [200] /admin/register 136ms isAdminAccountCreated register false json register {"data":{"firstName":"John","lastName":"Doe","email":"test@gmail.com","password":"123456789","role":"admin"}} http://localhost:4321/api/v1/users Error: TypeError: fetch failed at node:internal/deps/undici/undici:13502:13 at async eval (D:/mywebsite/sonicjs/sonicjs/src/pages/admin/register/index.astro:42:26) at async callComponentAsTemplateResultOrResponse (file:///D:/mywebsite/sonicjs/sonicjs/node_modules/astro/dist/runtime/server/render/astro/render.js:90:25) ... [cause]: Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:216:20) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { errno: -4077, code: 'ECONNRESET', syscall: 'read' } }
已查阅GitHub issues并咨询AI,未找到有效解决方案,请求协助排查问题。
内容的提问来源于stack exchange,提问作者Loen
相关产品推荐
相关产品推荐

