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

help: The sitemap cannot be accessed in production #373

Open
liuchuansmile opened this issue Oct 15, 2024 · 4 comments
Open

help: The sitemap cannot be accessed in production #373

liuchuansmile opened this issue Oct 15, 2024 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@liuchuansmile
Copy link

liuchuansmile commented Oct 15, 2024

📚 What are you trying to do?

@nuxtjs/sitemap uses default configuration, not configured separately in nuxt.config.js

  1. My project is in SSR mode, running locally in yarn dev, with /preview access to the subdirectory sitemap
  2. But when you run it through node after yarn build, you no longer have access to subpaths
    Image
    Image

🔍 What have you tried?

No response

ℹ️ Additional context

No response

@liuchuansmile liuchuansmile added the help wanted Extra attention is needed label Oct 15, 2024
@rayblair06
Copy link
Contributor

Have you set the site url correctly in defineNuxtConfig?

https://nuxtseo.com/sitemap/getting-started/installation

When you say production, do you just mean via yarn build command or is localhost always set no matter the environment?

If possible, it would be great if you could create a repo with your configuration either within Github or https://stackblitz.com/?

@liuchuansmile
Copy link
Author

@rayblair06 Thanks for the reply. My local setup looks like this:

export default defineNuxtConfig({
  site: {
    url: `https://${PROD_DOMAIN}`,
    name: title,
  },
})

In fact, forgive me if I don't understand the configuration in the official documentation.

When I tried the simplest version on stackblitz, it seemed to work. This is weird. It looks like I have a local configuration conflict or a version issue?

My stackblitz projecit is : here

@harlan-zw
Copy link
Collaborator

As the Stackblitz reproduction is working there's not too much I can help with. Are you deploying with any specific nitro preset?

@liuchuansmile
Copy link
Author

@harlan-zw it's just that

  nitro: {
    esbuild: {
      options: {
        target: 'esnext',
      },
    },
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants