docs: correct param?: Type mistake impact — breaks dev HMR, not just builds
Mistake #19 (and BOOTSTRAP item #10) incorrectly stated the dev server is unaffected. In practice, saving the file triggers Vite HMR which hits the same SyntaxError and crashes the page with a 500. Confirmed in session where sign_in_out.svelte used presenter_id_hint?: string | null. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -250,9 +250,11 @@ the gate is ever actually in the "off" state before assuming it needs to exist.
|
||||
|
||||
### 19) `param?: Type` in `.svelte` function or snippet parameter positions
|
||||
|
||||
**Impact:** `vite build` SSR step fails with "Expected ',', got '?'" — Docker builds and
|
||||
production deploys break. Dev server is unaffected (different code path), so the error is
|
||||
invisible in local development and only surfaces in CI/CD or the first clean Docker build.
|
||||
**Impact:** Breaks both dev and production. In dev mode, Vite's HMR recompile produces
|
||||
`SyntaxError: missing ) after formal parameters` in `app.js`, which crashes the page with a
|
||||
500 error immediately after saving the file. In production, `vite build` fails at the SSR
|
||||
step with "Expected ',', got '?'" — Docker builds and deploys break. The error surfaces in
|
||||
both environments; do not assume the dev server is a safe testing ground for this.
|
||||
|
||||
**What happened:** Source files used TypeScript optional-parameter syntax (`param?: Type`)
|
||||
inside `.svelte` `<script lang="ts">` functions and `{#snippet}` parameter lists. esbuild
|
||||
|
||||
Reference in New Issue
Block a user