nuxt-community / sitemap-module

Sitemap Module for Nuxt 2
https://sitemap.nuxtjs.org
MIT License
690 stars 128 forks source link

sitemap is being tried to generate during SPA build, but no backend is available at build time! #224

Closed kovan closed 3 years ago

kovan commented 3 years ago

How to fix? My route generation function needs that the backend is running to generate the routes. When I was using SSR all was fine, since generation of the sitemap was not at build time, but when it was requested for the first time.

Is it possible to replicate this behavior when not using SSR? (SPA mode).

Example:

`$ npm run build

nuxt-prueba@1.0.1 build nuxt build

ℹ [HPM] Proxy created: /api -> http://localhost:8000 21:44:42 ℹ Modern bundles are detected. Modern mode (client) is enabled now. 21:44:42 ℹ Production build 21:44:43 ℹ Bundling only for client side 21:44:43 ℹ Target: static

(...)

ℹ Generating output directory: dist/ 21:44:52 ℹ Generating pages 21:44:52 ✔ Generated route "/" 21:44:52 ✔ Client-side fallback created: 200.html 21:44:52 ℹ Generating sitemaps 21:44:52

FATAL connect ECONNREFUSED 127.0.0.1:8000 `

kovan commented 3 years ago

I realized this is a nonsense, since now in SPA mode there is no server to generate the sitemap. Closing.