fix: error "27" (#5122)

* fix: error 27

* fix: sentry only in prod

* fix: sentry env

* Revert "fix: error 27"

This reverts commit 66ee482a0567a5e53326e576b1bc6af0542a7fe3.

* feat: attempt to fix error 27
This commit is contained in:
Calum H.
2026-01-15 00:38:23 +00:00
committed by GitHub
parent 3ffa78aa07
commit 454c708fd6
6 changed files with 39 additions and 11 deletions

View File

@@ -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: {

View File

@@ -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 }),
)

View File

@@ -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/",