I'm using Nuxt 2.15 with target: "static"
and hosting on a shared hosting "hostinger". I fetch the data from an external API using axios and Vuex state management and here comes the problem where the app doesn't load the new data it gets from the API.
How can I make the app rerenders its data and output the newly updated data it gets from fetching the API?
I assume you are using nuxtServerInit or asyncData for getting the data from API. This used with static mode means that data is get only during generation. Which is great for not too often updated content because it doesn't have to connect to server every time it's faster.
Depend on your needs you can:
EDIT: as @kissu corrected me in comment this one is deprecated, please use this one: target:'server'
instead of target:'static'
, which is default so you can just remove this line (https://nuxtjs.org/docs/configuration-glossary/configuration-target/ )