kb
kb
Explore posts from servers
NNuxt
Created by kb on 4/2/2025 in #❓・help
defineCachedEventHandler strips out headers
ooh
19 replies
NNuxt
Created by kb on 4/2/2025 in #❓・help
defineCachedEventHandler strips out headers
@kapa.ai how best to do caching & swr then, in a server nitro route?
19 replies
NNuxt
Created by kb on 4/2/2025 in #❓・help
defineCachedEventHandler strips out headers
@kapa.ai can i access the useRequestHeaders composable from a nitro server route though?
19 replies
NNuxt
Created by kb on 2/20/2025 in #❓・help
NuxtImg IPX 429 issues
any future searchers, this was the Nuxt Security modules rate limiter.
36 replies
NNuxt
Created by kb on 2/20/2025 in #❓・help
NuxtImg IPX 429 issues
@kapa.ai i just ran this
import fetch from 'node-fetch'

const IMAGE_URL = 'https://images.domain.co.uk/uploads/images/banner/xxhdpi_3x/1739548674HeroBanner.png'
const REQUEST_COUNT = 200

async function fetchImage(index) {
try {
const response = await fetch(IMAGE_URL, {
headers: {
'User-Agent': 'Mozilla/5.0',
},
})
console.log(`Request ${index + 1}: Status ${response.status}`)
} catch (error) {
console.log(`Request ${index + 1}: Failed`, error.message)
}
}

async function testRateLimit() {
const requests = Array.from({ length: REQUEST_COUNT }, (_, i) => fetchImage(i))
await Promise.all(requests)
console.log('Test completed.')
}

testRateLimit()
import fetch from 'node-fetch'

const IMAGE_URL = 'https://images.domain.co.uk/uploads/images/banner/xxhdpi_3x/1739548674HeroBanner.png'
const REQUEST_COUNT = 200

async function fetchImage(index) {
try {
const response = await fetch(IMAGE_URL, {
headers: {
'User-Agent': 'Mozilla/5.0',
},
})
console.log(`Request ${index + 1}: Status ${response.status}`)
} catch (error) {
console.log(`Request ${index + 1}: Failed`, error.message)
}
}

async function testRateLimit() {
const requests = Array.from({ length: REQUEST_COUNT }, (_, i) => fetchImage(i))
await Promise.all(requests)
console.log('Test completed.')
}

testRateLimit()
i didnt get a single 429, so i think its the server running my nuxt instance, not the images domain
36 replies
NNuxt
Created by kb on 2/20/2025 in #❓・help
NuxtImg IPX 429 issues
@kapa.ai how can i increase the threshold for my local nuxt server, 429'ing me?
36 replies
NNuxt
Created by kb on 2/20/2025 in #❓・help
NuxtImg IPX 429 issues
ive learnt nothing & ill be happy about it @kapa.ai
36 replies
NNuxt
Created by kb on 2/20/2025 in #❓・help
NuxtImg IPX 429 issues
@kapa.ai there are no errors in my console when this occurs. only the client side 429 rejections. the server side (my vs code terminal) is empty
36 replies
NNuxt
Created by kb on 2/20/2025 in #❓・help
NuxtImg IPX 429 issues
@kapa.ai how can i monitor if the external service is rejecting it?
36 replies
NNuxt
Created by kb on 2/20/2025 in #❓・help
NuxtImg IPX 429 issues
how can i monitor if the external service is rejecting it?
36 replies
NNuxt
Created by kb on 2/20/2025 in #❓・help
NuxtImg IPX 429 issues
@kapa.ai heres an example request URL that has 429'd http://localhost:3000/_ipx/animated_true&w_1920/https://images.domain.co.uk/uploads/images/categories/xxhdpi_3x/1658136812Chilled.png
36 replies
NNuxt
Created by kb on 11/21/2024 in #❓・help
Error pages
@kapa.ai I did that already and it doesnt work, it just shows the layout. the docs also say You can use <NuxtLayout /> component to activate the default layout on app.vue or error.vue. so 🤷‍♂️
10 replies
NNuxt
Created by kb on 11/11/2024 in #❓・help
useAsyncData/useFetch > Function > Pinia Action - Best practices?
anyone got any wise words on this 😄
7 replies
NNuxt
Created by kb on 11/8/2024 in #❓・help
Nuxt OG Image works locally but not deployed
ah - i dont actually have the main module in my dependencies - guess i need a resolution to lock it at a required version or something
10 replies
NNuxt
Created by kb on 11/8/2024 in #❓・help
Nuxt OG Image works locally but not deployed
it does work if i serve it locally, just not on vercel?
10 replies
NNuxt
Created by Rejox on 8/10/2024 in #❓・help
defineOgImageComponent is not defined
No description
9 replies
NNuxt
Created by Rejox on 8/10/2024 in #❓・help
defineOgImageComponent is not defined
though while your about - there a common gotcha for it working locally, being visible in devtools, but then prod it just aint? 😆
9 replies
NNuxt
Created by Rejox on 8/10/2024 in #❓・help
defineOgImageComponent is not defined
it was my bad - i expected it to prefill the modules within nuxt config - muscle memory, so I just wasnt loading the module!
9 replies
NNuxt
Created by Rejox on 8/10/2024 in #❓・help
defineOgImageComponent is not defined
ever find a fix for this? @Rejox
9 replies
NNuxt
Created by kb on 11/7/2024 in #❓・help
NuxtImg + Vercel
every doc says something different. this cannot be what i need to do surely
image: {
screens: {
56: 56,
66: 66,
70: 70,
78: 78,
88: 88,
94: 94,
100: 100,
104: 104,
110: 110,
114: 114,
120: 120,
126: 126,
130: 130,
131: 131,
136: 136,
146: 146,
148: 148,
163: 163,
164: 164,
179: 179,
180: 180,
225: 225,
226: 226,
227: 227,
},
vercel: {
screens: {
56: 56,
66: 66,
70: 70,
78: 78,
88: 88,
94: 94,
100: 100,
104: 104,
110: 110,
114: 114,
120: 120,
126: 126,
130: 130,
131: 131,
136: 136,
146: 146,
148: 148,
163: 163,
164: 164,
179: 179,
180: 180,
225: 225,
226: 226,
227: 227,
},
},
},
image: {
screens: {
56: 56,
66: 66,
70: 70,
78: 78,
88: 88,
94: 94,
100: 100,
104: 104,
110: 110,
114: 114,
120: 120,
126: 126,
130: 130,
131: 131,
136: 136,
146: 146,
148: 148,
163: 163,
164: 164,
179: 179,
180: 180,
225: 225,
226: 226,
227: 227,
},
vercel: {
screens: {
56: 56,
66: 66,
70: 70,
78: 78,
88: 88,
94: 94,
100: 100,
104: 104,
110: 110,
114: 114,
120: 120,
126: 126,
130: 130,
131: 131,
136: 136,
146: 146,
148: 148,
163: 163,
164: 164,
179: 179,
180: 180,
225: 225,
226: 226,
227: 227,
},
},
},
11 replies