-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Inconsistency between dev and build with trailing slash #4638
Comments
You want to use |
@matthewp I ran into this issue as well. Adding |
I think this is not obvious to the uninitiated. I spent longer than I would have liked trying to figure it out. When trying to identify the current page from the const posts = await Astro.glob('../pages/blog/*');
const currIndex = posts.findIndex(o => o.url === Astro.url.pathname);
const prev = posts[currIndex - 1];
const next = posts[currIndex + 1]; ...I thought it was an |
I would love to re-open this issue and work on it. The issue I'm having is that for a production build there is no way to have I'm doing this regex workaround now to conditionally remove a trailing slash const pathname = Astro.url.pathname.replace(/\/$/, "") It would be great if there was a way to make production builds not include trailing slashes if that's someone's preference. |
@tylerwray that would be great. I am also still looking for a solution to the issue #5349 |
This is a known issue in Astro: withastro/astro#4638
What version of
astro
are you using?1.1.5
Are you using an SSR adapter? If so, which one?
none
What package manager are you using?
yarn
What operating system are you using?
Mac
Describe the Bug
working with astro 1.1.5
with astro dev this doesn't return a trailing '/' whereas astro build does.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-rc3xnz?file=src%2Fpages%2Findex.astro,src%2Fpages%2Fbug.astro,package.json&on=stackblitz
Participation
The text was updated successfully, but these errors were encountered: