Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sitemap.xml generated in Travis CI build have routes relative to Travis CI build job and not actual routes. #82

Closed
liyasthomas opened this issue Oct 2, 2019 · 3 comments

Comments

@liyasthomas
Copy link

Version

2.0

Reproduction link

https://postwoman.io/sitemap.xml

Steps to reproduce

  1. Build nuxt application in Travis CI
  2. Deploy the application
  3. Find the /sitemap.xml generated
  4. Routes are relative to CI build job and not actual routes

What is expected ?

Routes should be relative to base path and not relative to build environment.

What is actually happening?

Instead of base path, build environment is considered as the root and /pages/routes are set relative to build enironment

This bug report is available on Nuxt community (#c68)
@ghost ghost added the cmty:bug-report label Oct 2, 2019
@liyasthomas
Copy link
Author

sitemap.xml generated from Travis CI build

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url>
<loc>
http://travis-job-1c77f852-f86a-4ec6-8538-7abaa8d83c7f/settings
</loc>
</url>
<url>
<loc>
http://travis-job-1c77f852-f86a-4ec6-8538-7abaa8d83c7f/websocket
</loc>
</url>
<url>
<loc>
http://travis-job-1c77f852-f86a-4ec6-8538-7abaa8d83c7f/
</loc>
</url>
</urlset>

See the route locations are relative to build environment rather than base path.

@NicoPennec
Copy link
Member

I have checked your nuxt config and you build on spa mode.

In spa and generate mode, the "hostname" option is mandatory, because on build time nuxt can't know your final hostname. It can do it only on universal mode thanks to a Node.js server.
see doc: https://github.com/nuxt-community/sitemap-module#hostname-optional---string

I just created a PR to fix your config: hoppscotch/hoppscotch#177

@liyasthomas
Copy link
Author

Thanks for the quick PR 🚀
Issue has been fixed and hence closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants