Skip to content

Commit

Permalink
fix: calling server functions without arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
pureliani committed Feb 13, 2024
1 parent ca88b96 commit af6475d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
6 changes: 3 additions & 3 deletions packages/start/config/server-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function createChunk(data) {
return new TextEncoder().encode(`;0x${totalHex};${data}`);
}

function serializeToStream(id, value) {
function serializeToStream(id: string, value) {
return new ReadableStream({
start(controller) {
crossSerializeStream(value, {
Expand Down Expand Up @@ -95,8 +95,8 @@ async function handleServerFunction(h3Event) {
if (h3Event.method === "POST") {
const contentType = request.headers.get("content-type");
if (
contentType.startsWith("multipart/form-data") ||
contentType.startsWith("application/x-www-form-urlencoded")
contentType?.startsWith("multipart/form-data") ||
contentType?.startsWith("application/x-www-form-urlencoded")
) {
// workaround for https://github.com/unjs/nitro/issues/1721
// (issue only in edge runtimes)
Expand Down
2 changes: 2 additions & 0 deletions packages/start/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"strict": true,
"noUncheckedIndexedAccess": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
Expand Down
26 changes: 13 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit af6475d

Please sign in to comment.