Skip to content

localizeHref can't run on edge functions runtime (Deno) #540

@Wituareard

Description

@Wituareard

...because "window" is present and so it tries to access "window.location.href". I tried to resolve the stacktrace from #538 and this is what I got:

TypeError: Cannot read properties of undefined (reading 'href')
  at C4 (../../src/lib/paraglide/runtime.js:300:54)
  at setLocale (../../src/lib/paraglide/runtime.js:183:16)
  at getLocale (../../src/lib/paraglide/runtime.js:1155:26)
  at localizeHref (../../src/lib/components/navbar/universal/UniversalNavbar.svelte:11:19)
  at fn (../../node_modules/.pnpm/[email protected]/node_modules/svelte/src/runtime/internal/ssr.js:134:15)
  at <anonymous> (../../src/lib/components/navbar/universal/UniversalNavbar.svelte:25:30)
  at fn (../../node_modules/.pnpm/[email protected]/node_modules/svelte/src/runtime/internal/ssr.js:134:15)
  at $$props (../../src/lib/components/navbar/Navbar.svelte:6:21)
  at fn (../../node_modules/.pnpm/[email protected]/node_modules/svelte/src/runtime/internal/ssr.js:134:15)
  at $$props (../../src/routes/header.svelte:12:21)

I think the function names are off by one line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    l10nLocalization (translation across languages and cultures)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions