Netlify + Nuxt 3 - constant issue with trailing slashes added

Site name - silly-keller-2bc6e2
domain - swiadomypodpis.pl

  • Did you try Ask Netlify, our generative AI chatbot, before posting? It pulls info from Support Guides and recent solved forums posts. - YES!

We are facing a constant issue with a trailing slash being added to our URLs in a static site generated by nuxt generate. We have Pretty URL disabled.

Here is how the problem looks:
Whenever we visit our page and navigate to subpages like “/umowy-b2b”, Netlify adds a trailing slash at the end of the URL - “umowy-b2b/”, which causes two things:

  1. Google thinks there’s another URL with the same content, indicating duplication in URLs.
  2. We fetch page data from the CMS based on the URL (data like description, title, etc., for translation purposes), so with the mismatched URL, the data is not requested.

What we have tried:

  1. Adding _redirect to Netlify with content like “umowy-b2b/ umowy-b2b 301!”, which causes an infinite redirect loop.
  2. Adding a redirect directly as Nuxt middleware.
  3. Adding a canonical URL to every page.
  4. Fixing sitemaps.

Nothing seems to help; Netlify still adds trailing slashes, which causes Google to misunderstand the page content and proper links, leading to SEO errors, incorrect URLs in Google search results, and issues in ads.

I’m not able to reproduce this. Loading /umowy-b2b doesn’t redirect to /umowy-b2b/ for me.