Uzyxen
Uzyxen
NNuxt
Created by Uzyxen on 3/25/2025 in #❓・help
i18n [plugin:nuxtjs:i18n-resource] Cannot read properties of undefined (reading 'options')
I added older version (8.0.0) and it works
18 replies
NNuxt
Created by Uzyxen on 3/25/2025 in #❓・help
i18n [plugin:nuxtjs:i18n-resource] Cannot read properties of undefined (reading 'options')
idk what im doing wrong. i18n.config.ts in the root:
export default defineI18nConfig(() => ({
legacy: false,
locale: 'en',
messages: {
en: {
welcome: 'Welcome'
},
nl: {
welcome: 'Welkom'
}
}
}));
export default defineI18nConfig(() => ({
legacy: false,
locale: 'en',
messages: {
en: {
welcome: 'Welcome'
},
nl: {
welcome: 'Welkom'
}
}
}));
and nuxt.config.ts:
i18n: {
bundle: {
optimizeTranslationDirective: false,
},
locales: [
{ code: 'en', language: 'en-US' },
{ code: 'nl', language: 'nl-NL' }
],
strategy: 'prefix',
defaultLocale: 'en',
vueI18n: '~/i18n.config.ts' ,
},
i18n: {
bundle: {
optimizeTranslationDirective: false,
},
locales: [
{ code: 'en', language: 'en-US' },
{ code: 'nl', language: 'nl-NL' }
],
strategy: 'prefix',
defaultLocale: 'en',
vueI18n: '~/i18n.config.ts' ,
},
and im still getting:
ERROR Internal server error: Cannot read properties of undefined (reading 'options')
Plugin: nuxtjs:i18n-resource
File: /Users/uzyxen/Desktop/active-projects/engravebart/i18n.config.ts

WARN [Vue Router warn]: No match found for location with path "/_nuxt/i18n.config.ts"
ERROR Internal server error: Cannot read properties of undefined (reading 'options')
Plugin: nuxtjs:i18n-resource
File: /Users/uzyxen/Desktop/active-projects/engravebart/i18n.config.ts

WARN [Vue Router warn]: No match found for location with path "/_nuxt/i18n.config.ts"
@kapa.ai
18 replies
NNuxt
Created by Uzyxen on 3/25/2025 in #❓・help
i18n [plugin:nuxtjs:i18n-resource] Cannot read properties of undefined (reading 'options')
Thank You, I'll see it soon
18 replies
NNuxt
Created by Uzyxen on 3/25/2025 in #❓・help
i18n [plugin:nuxtjs:i18n-resource] Cannot read properties of undefined (reading 'options')
when I moved i18n.config.ts to the root I get the message [@nuxtjs/i18n 8:22:47 PM] WARN Vue I18n configuration file ./i18n.config.ts not found in /Users/uzyxen/Desktop/active-projects/<project-name>/i18n. Skipping... @kapa.ai
18 replies
NNuxt
Created by Uzyxen on 11/17/2024 in #❓・help
middleware
@kapa.ai I used method 3. And it works. I have question. Is it a good idea to fetch initial JWT token in plugin? How many times api will be called?
10 replies
NNuxt
Created by Uzyxen on 11/4/2024 in #❓・help
useFetch server-side
I'm getting an error "hydration text content mismatch on". I have to send useFetch requests in a loop and add responses to the array. For a while it's good and array has few different elements but after 1-2 seconds it's the same code:
const { data: images } = await useFetch(`http://localhost:5271/api/image/uploadGalleryImages/${id}`, {
responseType: 'json',
method: 'get',
headers: {
'Content-Type': 'application/json',
}
});

const files = ref([]);
const formData = new FormData();
const imageSrc = ref(null); // Ustawienie na null na początku

for (const image of images.value) {
const { data: singleImage } = await useFetch('http://localhost:5271/api/image/uploadGallerySingleImage', {
responseType: 'arrayBuffer',
method: 'post',
body: JSON.stringify({
ImagePath: image.imageSource
}),
headers: {
'Content-Type': 'application/json',
},
server: true,
lazy: false
});

console.log(singleImage);

//console.log(singleImage);

const mimeType = "image/png";
const blob = new Blob([singleImage.value], { type: mimeType });
const file = new File([blob], image.imageSource.split('/').pop(), { type: mimeType });

//console.log(file);

//console.log(singleImage);
files.value.push(file);
}
const { data: images } = await useFetch(`http://localhost:5271/api/image/uploadGalleryImages/${id}`, {
responseType: 'json',
method: 'get',
headers: {
'Content-Type': 'application/json',
}
});

const files = ref([]);
const formData = new FormData();
const imageSrc = ref(null); // Ustawienie na null na początku

for (const image of images.value) {
const { data: singleImage } = await useFetch('http://localhost:5271/api/image/uploadGallerySingleImage', {
responseType: 'arrayBuffer',
method: 'post',
body: JSON.stringify({
ImagePath: image.imageSource
}),
headers: {
'Content-Type': 'application/json',
},
server: true,
lazy: false
});

console.log(singleImage);

//console.log(singleImage);

const mimeType = "image/png";
const blob = new Blob([singleImage.value], { type: mimeType });
const file = new File([blob], image.imageSource.split('/').pop(), { type: mimeType });

//console.log(file);

//console.log(singleImage);
files.value.push(file);
}
@kapa.ai
10 replies
NNuxt
Created by Uzyxen on 11/3/2024 in #❓・help
$fetch from client vs from server
@kapa.ai but I allowed all methods and headers: builder.Services.AddCors(options => { options.AddPolicy("AllowNuxtApp", builder => builder .WithOrigins("http://localhost:3000") // Nuxt app URL .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials()); });
11 replies
NNuxt
Created by Uzyxen on 11/3/2024 in #❓・help
$fetch from client vs from server
No description
11 replies