Skip to content

Commit

Permalink
Merge pull request #1329 from pureliani/fix/server-functions-without-…
Browse files Browse the repository at this point in the history
…arguments

Fix: calling server functions without arguments
  • Loading branch information
ryansolid authored Feb 13, 2024
2 parents ca88b96 + b422f70 commit 95a1e08
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-spies-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": patch
---

Fix: calling server functions without arguments, TS strict
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 95a1e08

Please sign in to comment.