fix(dev): Deno 2.8 compat for local function runner (Deno.serve getter)#533
Open
yurynix wants to merge 1 commit into
Open
fix(dev): Deno 2.8 compat for local function runner (Deno.serve getter)#533yurynix wants to merge 1 commit into
yurynix wants to merge 1 commit into
Conversation
Deno 2.8 exposes `Deno.serve` as a getter-only property, so the wrapper's plain `Deno.serve = ...` assignment throws `TypeError: Cannot set property serve ... which has only a getter`. The function process crashes on startup, the dev-server proxy can't reach it, and requests return 500. Override it with Object.defineProperty (writable + configurable) instead, which works on both the old writable property and the new 2.8 accessor. CI installs Deno via `setup-deno@v2` with `deno-version: v2.x`, which now floats to 2.8.1 — this is why the local-functions dev tests started failing on every PR despite no related code change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.52-pr.533.ff4deadPrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.52-pr.533.ff4dead"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.52-pr.533.ff4dead"
}
}
Preview published to npm registry — try new features instantly! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Description
Fixes
base44 devfailing under Deno 2.8, which redefinedDeno.serveas a getter-only property. The previous direct assignment (Deno.serve = ...) now throws at runtime. This PR usesObject.definePropertyto overrideDeno.serveso the runtime works on both pre-2.8 (writable property) and 2.8+ (accessor) versions of Deno.Related Issue
None
Type of Change
Changes Made
Deno.servepatch logic into apatchedServeconstant inpackages/cli/deno-runtime/main.ts.Deno.serve = ...assignment (which fails on Deno 2.8) withObject.defineProperty(Deno, "serve", { value: patchedServe, writable: true, configurable: true }).@ts-expect-errorpreviously needed for the direct assignment.Testing
npm test)Checklist
Additional Notes
Behavior on older Deno versions is preserved:
definePropertyworks on both the previous writable property and the new accessor. No public CLI surface changes.🤖 Generated by Claude | 2026-06-02 11:43 UTC | ff4dead