npm run generate
was working great, until I added bunch of dynamic routes and it seems to be too heavy for it to generate? There are random times where the ms is "3-4" and if I check the folder it's empty, also npm run generate
doesn't really ever finish it throws because it fails to retrieve from the api inside the data method (it's local and always returns 202 no really any api issues)
Here is the error (it's fixed data so I always expect to find the name)
It might be that the express server hangs? that will be totally weird I tested it while generate is running always working, it happens with routes that have data method:
<script>
import axios from 'axios';
import SearchForm from '~components/search-form.vue';
import Card from '~components/card.vue';
export default {
components: {
SearchForm,
Card,
},
layout: 'page',
head() {
return {
title: `Page for ${this.airport.name} | Website`,
}
},
data({ params, error }) {
const slug = params.slug;
return axios.get(`http://localhost:3000/api/airport/${slug}`)
.then((res) => {
return {
airport: res.data.airport,
};
}).catch((err) => {
error({ statusCode: 404, message: 'Countries page not found' })
});
}
}
</script>
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c188">#c188</a>)</em></sub></div>