Fix/merge regression 2026 01 26#4
Conversation
- Fix missing imports and filename conventions in remote functions documentation - Safely handle `decode_pathname` in `respond.js` to avoid 500 errors on malformed URIs - Fix missing backtick in `form.buttonProps` removal error message - Clarify Svelte version wording in integrations documentation - Fix grammar and consistency in `adapter-node` handler
There was a problem hiding this comment.
Pull request overview
This PR fixes several regressions and issues including a critical URI decoding bug, grammatical errors in error messages, and documentation improvements.
Changes:
- Adds proper error handling for malformed pathnames to prevent crashes when decoding the original URL path
- Fixes missing closing backticks in error messages for deprecated
form.buttonProps - Corrects grammatical errors in adapter-node error messages
- Improves documentation clarity and fixes import paths in examples
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/kit/src/version.js | Version bump to 2.50.1-tg.1 |
| packages/kit/package.json | Version bump to 2.50.1-tg.1 |
| packages/kit/src/runtime/server/respond.js | Adds try-catch for decoding original pathname to prevent crashes on malformed URIs |
| packages/kit/src/runtime/client/remote-functions/form.svelte.js | Fixes missing closing backtick in deprecated buttonProps error message |
| packages/kit/src/runtime/app/server/remote/form.js | Fixes missing closing backtick in deprecated buttonProps error message |
| packages/adapter-node/src/handler.js | Corrects grammar in error messages ("an invalid" → "invalid", "headers" → "header") |
| documentation/docs/60-appendix/20-integrations.md | Improves clarity by changing "before Svelte 5" to "uses Svelte 4 or earlier" |
| documentation/docs/20-core-concepts/60-remote-functions.md | Adds missing import statement and fixes import path, but has critical placement issue with script tag |
| <form {...survey}> | ||
| <h2>Which operating system do you use?</h2> | ||
|
|
||
| +++ <script> | ||
| import { operatingSystems, languages, survey } from './data.remote'; | ||
| </script>+++ | ||
|
|
There was a problem hiding this comment.
The script tag is incorrectly placed inside the form element. In Svelte components, the script tag must be at the top of the component file, before any markup. It should be placed before the opening form tag on line 409, not after the h2 element on line 410.
| <form {...survey}> | |
| <h2>Which operating system do you use?</h2> | |
| +++ <script> | |
| import { operatingSystems, languages, survey } from './data.remote'; | |
| </script>+++ | |
| +++ <script> | |
| import { operatingSystems, languages, survey } from './data.remote'; | |
| </script>+++ | |
| <form {...survey}> | |
| <h2>Which operating system do you use?</h2> |
There was a problem hiding this comment.
1 issue found across 8 files
Confidence score: 4/5
- This PR looks safe to merge overall; the main issue is limited to a documentation example rather than core logic.
- In
documentation/docs/20-core-concepts/60-remote-functions.md, the<script>block is placed inside markup, which can cause a Svelte compilation error for readers following the example. - Pay close attention to
documentation/docs/20-core-concepts/60-remote-functions.md- move the<script>block to top-level to avoid Svelte compile errors.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="documentation/docs/20-core-concepts/60-remote-functions.md">
<violation number="1" location="documentation/docs/20-core-concepts/60-remote-functions.md:412">
P2: Move the `<script>` block to the top level of the example. Imports inside markup will cause a Svelte compilation error.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| <form {...survey}> | ||
| <h2>Which operating system do you use?</h2> | ||
|
|
||
| +++ <script> |
There was a problem hiding this comment.
P2: Move the <script> block to the top level of the example. Imports inside markup will cause a Svelte compilation error.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At documentation/docs/20-core-concepts/60-remote-functions.md, line 412:
<comment>Move the `<script>` block to the top level of the example. Imports inside markup will cause a Svelte compilation error.</comment>
<file context>
@@ -409,6 +409,10 @@ export const survey = form(
<form {...survey}>
<h2>Which operating system do you use?</h2>
++++ <script>
+ import { operatingSystems, languages, survey } from './data.remote';
+ </script>+++
</file context>
- Fix internal import path in form-utils.js (@sveltejs/kit -> @tg-svelte/kit) - Update pnpm-lock.yaml with fixed dependencies
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits
Summary by cubic
Fixes a regression that caused 500s on malformed URIs and tidies error messages and docs around remote functions. Also bumps Kit to 2.50.1-tg.1.
Bug Fixes
Documentation
.remotefilename usage in remote functions examples.Written for commit 8ad2999. Summary will update on new commits.