solid-start
solid-start copied to clipboard
[Bug?]: server function that contain await prisma function will throws error
Duplicates
- [x] I have searched the existing issues
Latest version
- [X] I have tested the latest version
Current behavior 😯
async function WithOutAwait(){
"use server"
prisma.$executeRaw`SELECT * From User`;
return console.log("WithOutAwait: ok");
}
async function WithAwait(){
"use server"
await prisma.$executeRaw`SELECT * From User`;
return console.log("WithAwait: ok");
}
<button onClick={()=>WithOutAwait()} />
// Click: WithOutAwait: ok
<button onClick={()=>WithAwait()} />
// Click: Error:
// [nitro] [request error] [unhandled] Invalid character in header content ["X-Error"]
// at ServerResponse.setHeader (node:_http_outgoing:706:3)
// at setResponseHeader (/D:/**/solid-project/.output/server/chunks/runtime.mjs:2528:18)
// at /D:/**/solid-project/.output/server/chunks/runtime.mjs:5724:1057
// at Object.ye$1 [as handler] (/D:/**/solid-project/.output/server/chunks/runtime.mjs:6067:6371)
// at async /D:/**/solid-project/.output/server/chunks/runtime.mjs:3039:19
// at async Object.callAsync (/D:/**/solid-project/.output/server/chunks/runtime.mjs:5340:16)
// at async Server.toNodeHandle (/D:/**/solid-project/.output/server/chunks/runtime.mjs:3305:7)
Expected behavior 🤔
The second button should work like the first.
Steps to reproduce 🕹
Copy code in solid-start template with prisma can reproduce this.
Context 🔦
No response
Your environment 🌎
OS: Microsoft Windows [version 10.0.22631.3593]
Node: 21.6.1
Bun: 1.1.10 (use as package manager)
Pnpm: 9.1.2
Solid-Start: 1.0.0