diff --git a/apps/frontend/nuxt.config.ts b/apps/frontend/nuxt.config.ts index 0f9147e55f..8a865bebf5 100644 --- a/apps/frontend/nuxt.config.ts +++ b/apps/frontend/nuxt.config.ts @@ -222,7 +222,13 @@ export default defineNuxtConfig({ }, }, }, - modules: ['@nuxtjs/i18n', '@pinia/nuxt', 'floating-vue/nuxt', '@sentry/nuxt/module'], + modules: [ + '@nuxtjs/i18n', + '@pinia/nuxt', + 'floating-vue/nuxt', + // Sentry causes rollup-plugin-inject errors in dev, only enable in production + ...(isProduction() ? ['@sentry/nuxt/module'] : []), + ], floatingVue: { themes: { 'ribbit-popout': { @@ -314,7 +320,7 @@ export default defineNuxtConfig({ compatibilityDate: '2025-01-01', telemetry: false, experimental: { - asyncContext: isProduction(), + asyncContext: false, }, sourcemap: { client: 'hidden' }, sentry: { diff --git a/apps/frontend/src/utils/analytics.js b/apps/frontend/src/utils/analytics.js index cf933a6952..cfa73703db 100644 --- a/apps/frontend/src/utils/analytics.js +++ b/apps/frontend/src/utils/analytics.js @@ -1,6 +1,5 @@ import dayjs from 'dayjs' import { computed, ref, watch } from 'vue' -import { useI18n } from 'vue-i18n' // note: build step can miss unix import for some reason, so // we have to import it like this @@ -8,7 +7,8 @@ import { useI18n } from 'vue-i18n' const { unix } = dayjs export function useCountryNames(style = 'long') { - const { locale } = useI18n() + const { $i18n } = useNuxtApp() + const locale = $i18n.locale const displayNames = computed( () => new Intl.DisplayNames([locale.value], { type: 'region', style }), ) diff --git a/apps/frontend/wrangler.jsonc b/apps/frontend/wrangler.jsonc index 340b5c6baa..dc240cdf94 100644 --- a/apps/frontend/wrangler.jsonc +++ b/apps/frontend/wrangler.jsonc @@ -31,6 +31,7 @@ }, "vars": { "ENVIRONMENT": "production", + "SENTRY_ENVIRONMENT": "production", "BASE_URL": "https://api.modrinth.com/v2/", "BROWSER_BASE_URL": "https://api.modrinth.com/v2/", "PYRO_BASE_URL": "https://archon.modrinth.com/", @@ -45,6 +46,7 @@ "routes": ["staging.modrinth.com/*"], "vars": { "ENVIRONMENT": "staging", + "SENTRY_ENVIRONMENT": "staging", "BASE_URL": "https://staging-api.modrinth.com/v2/", "BROWSER_BASE_URL": "https://staging-api.modrinth.com/v2/", "PYRO_BASE_URL": "https://staging-archon.modrinth.com/", diff --git a/packages/ui/src/components/base/IntlFormatted.vue b/packages/ui/src/components/base/IntlFormatted.vue index 755cc59b82..5fe6b97e0b 100644 --- a/packages/ui/src/components/base/IntlFormatted.vue +++ b/packages/ui/src/components/base/IntlFormatted.vue @@ -1,9 +1,8 @@