site name: Netlify App
error: Request failed with status code 429 while deploying. For Example:
[error] getPastGames Request failed with status code 429
10:39:18 PM: at createError (node_modules/axios/lib/core/createError.js:16:15)
10:39:18 PM: at settle (node_modules/axios/lib/core/settle.js:17:12)
10:39:18 PM: at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)
10:39:18 PM: at IncomingMessage.emit (events.js:215:7)
10:39:18 PM: at endReadableNT (_stream_readable.js:1184:12)
10:39:18 PM: at processTicksAndRejections (internal/process/task_queues.js:80:21)
Dear community,
I spent a lot of time researching, unfortunately I can not make any progress. I am running a NUXT project hosted on Netlify. I am trying to generate dynamic routes. When deploying I always get the
429 error. I understand that there is an API overload. But for me it makes no sense where this overload comes from. Please see my nuxt.config.js. I also tried to add the intervall property with a high value of 3000. But that also doesn’t help.
import axios from 'axios';
let dynamicRoutes = () => {
return axios.get('https://www.ubc-stp.at/wordpress/wp-json/wp/v2/news?page=1&per_page=100&_embed=1').then(res => {
return res.data.map(news => `/newspage/${news.id}`)
})
}
export default {
// Target: https://go.nuxtjs.dev/config-target
static: true,
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'SKN St.Pölten Basketball',
htmlAttrs: {
lang: 'en',
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
hid: 'description',
name: 'description',
content:
'Webseite des Basketballvereins SKN St. Pölten Basketball. Ein Top-Team der Bet-At-Home Basketball Superliga.',
},
{ name: 'format-detection', content: 'telephone=no' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.png' }],
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: ['~/assets/styles/app.scss', 'swiper/swiper.scss'],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
{ src: '~/plugins/aos.client', ssr: false },
'~/plugins/data.server.js',
'~/plugins/filter.js',
{ src: '~/plugins/vue-awesome-swiper', ssr: true },
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/typescript
'@nuxt/typescript-build',
'@nuxtjs/google-fonts',
[
'nuxt-fontawesome',
{
component: 'fa',
imports: [
{ set: '@fortawesome/free-brands-svg-icons', icons: ['faTiktok'] },
],
},
],
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/bootstrap
'bootstrap-vue/nuxt',
'@nuxtjs/axios',
[
'nuxt-cookie-control',
{
locales: ['de'],
blockIframe: true,
controlButton: false,
barPosition: 'bottom-right',
colors: {
barBackground: '#1d314d',
},
text: {
barTitle: '',
acceptAll: 'Akzeptieren',
barDescription:
'Um die Website optimal gestalten und verbessern zu können, verwendet diese Website Cookies. Durch Bestätigung erklären Sie sich damit einverstanden, dass Cookies gesetzt werden.',
},
},
],
],
axios: {
baseURL: 'https://www.ubc-stp.at/wordpress',
},
bootstrapVue: {
icons: true,
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
vendor: ['aos'],
},
googleFonts: {
families: {
// a simple name
Roboto: true,
// a name with spaces
'Barlow+Condensed': true,
Poppins: true,
},
},
generate: {
fallback: true,
routes: dynamicRoutes,
intervall: 3000
},
env: {
apiKey: process.env.GOOGLE_MAPS_API_KEY,
}
}
The store.dispatch methods are doing the http requets to fetch the data in data.server.js:
export default async ({ store }) => {
await store.dispatch('getPastGames')
await store.dispatch('getSpielplan')
await store.dispatch('getNews')
await store.dispatch('getImpressum')
await store.dispatch('getDatenschutz')
await store.dispatch('getSuperliga')
await store.dispatch('getPartner')
await store.dispatch('getTrainingszeiten')
await store.dispatch('getTabelle')
await store.dispatch('getPosts')
await store.dispatch('getNachwuchsteams')
}
Am I trapped in any kind of loop with my API calls? Thank you very much for any help!