Fix Netlify edge function crash and remove importRuntimeWithoutVite workaround #548
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.

Summary
Fixes the paraglide window.location crash on cold Netlify edge function starts and removes the now-unnecessary
importRuntimeWithoutVite()workaround.(Apologies for the branch name pun - couldn't resist "deno-uncement" for removing cemented workarounds from our Deno edge code!)
Problem
Netlify's Deno 2.3.1 edge runtime provides a partial
windowstub wherewindowexists butwindow.locationis undefined. This breaks paraglide-js which assumeswindow.locationexists ifwindowexists, causing HTTP 500 errors on first request to dynamic pages.Solution
hooks.server.tsbefore paraglide loads, making Netlify's Deno behave like standard Deno/Node.jsimportRuntimeWithoutVite()function and use simple static imports now that we use paraglide's defaultisServercheckChanges
src/hooks.server.ts(detects Netlify Deno environment)isServeroverride inscripts/inlang-settings.ts(use paraglide default)importRuntimeWithoutVite()workaround functionTesting
pnpm dev,netlify serve/peoplerequest: HTTP 200 (was HTTP 500)Related Issues
Fixes: #538, #540
See: notes/20251113-paraglide-edge-function-investigation.md
🤖 Generated with Claude Code