diff --git a/front/src/env.d.ts b/front/src/env.d.ts index 0e44107..a392342 100644 --- a/front/src/env.d.ts +++ b/front/src/env.d.ts @@ -1,5 +1,9 @@ type EnvBoolean = "true" | "false"; +interface Window { + _paq?: unknown[]; +} + interface ImportMetaEnv { readonly STRAPI_URL: string; readonly SITE_URL: string; diff --git a/front/src/layouts/Layout.astro b/front/src/layouts/Layout.astro index 4e52d80..8f50b51 100644 --- a/front/src/layouts/Layout.astro +++ b/front/src/layouts/Layout.astro @@ -60,7 +60,9 @@ const { s = d.getElementsByTagName("script")[0]; g.async = true; g.src = u + "matomo.js"; - s.parentNode.insertBefore(g, s); + if (s?.parentNode) { + s.parentNode.insertBefore(g, s); + } })();