Skip to content

Commit f7bbfe1

Browse files
author
Anthony Bailey
committed
Paraglide compiler settings change to maximize compatibility with Deno
In #325 I'm looking at Deno vs Node compatibility issues. In that context, looks like the paraglide compilation options could benefit from these changes to disable async local storage, and know that window can be defined even on the server when running under Deno. This was based on some runtime analysis and general Deno/Node.js compatibility requirements from docs/Git issues - see pull request.
1 parent 325b0ba commit f7bbfe1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/inlang-settings.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ function regenerateSettings(verbose = false): void {
112112
project: './project.inlang',
113113
outdir: './src/lib/paraglide',
114114
strategy: ['url', 'cookie', 'preferredLanguage', 'baseLocale'],
115+
// Fix for Netlify Edge Functions (Deno runtime)
116+
disableAsyncLocalStorage: true,
117+
isServer: "typeof window === 'undefined' || typeof globalThis.Deno !== 'undefined'",
115118
// Create concrete URL patterns structure with current locale set
116119
urlPatterns: [
117120
{

0 commit comments

Comments
 (0)