opral / inlang-paraglide-js

Tree-shakable i18n library build on the inlang ecosystem.
https://inlang.com/m/gerre34r/library-inlang-paraglideJs
33 stars 0 forks source link

Properties of undefined (reading 'lang') custom 404 Astro page #175

Closed yudyananda closed 1 month ago

yudyananda commented 1 month ago

Hi, i just got an error Properties of undefined (reading 'lang') when using paraglide object from Astro.locals in custom 404 page.

// my layout
---
import { languageTag } from "../paraglide/runtime";
---
<!doctype html>
<html lang={languageTag()} dir={Astro.locals.paraglide.dir}>
    ...
</html>

Is there a way that we can do from the paraglide side?

samuelstroschein commented 1 month ago

Loris is on vacation this and next week. Response will take approx 9 days!

LorisSigrist commented 1 month ago

Hi @yudyananda

I've tried to reproduce this but it seems to work fine. I added a custom 404 page in opral/monorepo#3040. Both Astro.locals.paraglide.dir and languageTag() seem to work on the 404 page.

I know there are some Astro versions where the middleware wasn't being called correctly in production. Which version are you on?