-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Astro.url.pathname
includes trailing dash when building for SSG but not on dev mode
#5630
Comments
I believe this was intentional depending on the build.format config (since that option was added), but I had find this confusing too, and ideally would be nice if it's consistent. |
been facing the same bug, if i'm not mistaken there was a discussion about this in #4190, and the TL;DR was:
but i don't think it solves the inconsistency in the default behaviour between |
This commit replaces Astro local styles with tailwind equivalents. Due to `Astro.url.pathname` inconsistencies between development and production (see withastro/astro#5630), we strip the trailing slash when doing comparisons against the current pathname.
I am experiencing this too. This doesn't seem like a "minor bug". All my links work in dev and preview, but are broken in prod because of this. A relative link defined in
...goes to I just upgraded all packages and verified it's still happening. Astro 2.3.0 used for pure SSG. Edit: I've figured out how to fix by setting |
This commit replaces Astro local styles with tailwind equivalents. Due to `Astro.url.pathname` inconsistencies between development and production (see withastro/astro#5630), we strip the trailing slash when doing comparisons against the current pathname.
Similar issue: #6623. It would be a breaking change if we fix this, so will also mark it as so if we get around it in the next major. |
I don't think this is a bug. If you are using |
What version of
astro
are you using?1.7.1
Are you using an SSR adapter? If so, which one?
none
What package manager are you using?
npm
What operating system are you using?
Mac
Describe the Bug
Astro.url.pathname
returns a different value on dev mode (dev
command) and build command.Link to Minimal Reproducible Example
https://github.com/pilcrowOnPaper/astro-trailling-dash
Participation
The text was updated successfully, but these errors were encountered: