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: Why does the URL automatically end with /? I haven't set trailingSlash #349

Closed
WooHoo-Wu opened this issue Aug 27, 2024 · 15 comments
Closed
Labels
help wanted Extra attention is needed

Comments

@WooHoo-Wu
Copy link

📚 What are you trying to do?

image ![image](https://github.com/user-attachments/assets/e9b3cb2a-d8d8-4b41-95fd-91c2be16fe9f)

🔍 What have you tried?

No response

ℹ️ Additional context

No response

@WooHoo-Wu WooHoo-Wu added the help wanted Extra attention is needed label Aug 27, 2024
@WooHoo-Wu
Copy link
Author

I use @nuxtjs/seo, the latest sitemap version

@WooHoo-Wu
Copy link
Author

help me !!!

@WooHoo-Wu
Copy link
Author

When I set differentDomains: true, you will add /. I can't remove it in hooks('sitemap:resolved'). I need to set differentDomains: true, and the sitemap URL does not need to be followed by /. What should I do?

@WooHoo-Wu
Copy link
Author

Version v5.2.1 is OK, but nuxtjs/seo will update your version, which leads to this problem

@harlan-zw
Copy link
Collaborator

Can you make a reproduction? The only thing I can think of is that you've set the trailing slashes option somewhere.

@WooHoo-Wu
Copy link
Author

reproduction:
https://stackblitz.com/edit/nuxt-starter-h71ojo?file=package.json

result:
image

Please help me🥺

@WooHoo-Wu
Copy link
Author

https://nuxtstarterh71ojo-geb4--3000--9569b1ab.local-credentialless.webcontainer.io/__sitemap__/hr.xml

The above link can reproduce this problem. I didn't set anything. Shouldn't it remove the trailing slash by default?

It adds it now and I can't remove it? No matter what method I use, hooks can't remove it

@harlan-zw
Copy link
Collaborator

Yes I can confirm it's a bug, I'll take a look when I have a chance.

@WooHoo-Wu
Copy link
Author

Ok please asap I need it badly

@WooHoo-Wu
Copy link
Author

image

I debugged it myself and found that it was the problem at this location. I hope it will be helpful.

@harlan-zw
Copy link
Collaborator

Should be fixed in 6.0.0-beta.5 👍

@WooHoo-Wu
Copy link
Author

The @nuxtjs/seo module version is still 6.0.0-beta.2. I reinstalled @nuxtjs/sitemap and changed its version to 6.0.0-beta.5, but it still does not take effect in the production environment. What should I do?

image
image

@WooHoo-Wu
Copy link
Author

https://stackblitz.com/edit/nuxt-starter-h71ojo?file=package.json,nuxt.config.ts

It seems that the repair was not successful

@harlan-zw
Copy link
Collaborator

Seems fine to me, please make sure you update your lock file.

image

image

@WooHoo-Wu
Copy link
Author

thanks

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

2 participants