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

Regression: Pagination with [...page] doesn't work at the "root level" (src/pages) #4306

Closed
1 task done
castarco opened this issue Aug 13, 2022 · 6 comments · Fixed by #4426
Closed
1 task done

Regression: Pagination with [...page] doesn't work at the "root level" (src/pages) #4306

castarco opened this issue Aug 13, 2022 · 6 comments · Fixed by #4426
Assignees
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)

Comments

@castarco
Copy link
Contributor

castarco commented Aug 13, 2022

What version of astro are you using?

1.0.4, 1.0.5

Are you using an SSR adapter? If so, which one?


What package manager are you using?

yarn

What operating system are you using?

Linux (Ubuntu, x86_64)

Describe the Bug

When using the pattern [...page].astro inside the "root" directory (src/pages), only the 2nd and following pages are generated, while the first one is discarded.

Notes:

  • The bug was not present in 1.0.3
  • It can be mitigated by setting trailingSlash: 'always' in astro.config.mjs
  • This can't be seen when running yarn dev, only when looking at generated code via yarn build.
  • This doesn't happen when done inside other nested directories.

While we could use index.astro as a workaround, it can be quite cumbersome at the time of keeping track of pages.

Link to Minimal Reproducible Example

https://stackblitz.com/github/castarco/astro_pagination_bug_example

Participation

  • I am willing to submit a pull request for this issue.
@castarco castarco changed the title Pagination with [...page] doesn't work at the "root level" Pagination with [...page] doesn't work at the "root level" (src/pages) Aug 13, 2022
@castarco castarco changed the title Pagination with [...page] doesn't work at the "root level" (src/pages) Regression: Pagination with [...page] doesn't work at the "root level" (src/pages) Aug 13, 2022
@castarco
Copy link
Contributor Author

castarco commented Aug 13, 2022

It was probably introduced in this PR: #4265 , checking now...

@phocks
Copy link
Contributor

phocks commented Aug 15, 2022

I just noticed this is happening for me too ...

@natemoo-re
Copy link
Member

Thanks! I'm going to assign this to @matthewp since his PR seemed to cause the regression.

@natemoo-re natemoo-re added the - P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) label Aug 15, 2022
@phocks
Copy link
Contributor

phocks commented Aug 15, 2022

Reverting to [email protected] fixed this for me.

Edit: Actually just saw this https://github.com/Coder-Spirit/coder-spirit.github.io/pull/4 and it's a better fix. Just add

trailingSlash: 'always', to your astro config and it fixes it. Thanks @castarco

@phocks
Copy link
Contributor

phocks commented Aug 20, 2022

Thanks! I'm going to assign this to @matthewp since his PR seemed to cause the regression.

Also, my guess it that this was already maybe broken before the PR that made no trailing slashes the default. So we might have to go back to the original [...page] code.

@matthewp
Copy link
Contributor

Thanks for your patience, I'm looking into this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants