Skip to content

pagination fails in cloudflare pages #39

Closed

Description

@fancybody

I'll be using the prevPost and nextPost of https://astro-micro.vercel.app/blog/01-getting-started as reference point.

running this locally,

npm run build
npm run preview

the syntax of the resulting hrefs when viewed in a browser:

prevPost: http://localhost:4321/blog/00-micro-changelog
nextPost: http://localhost:4321/blog/02-blog-collection

Which is working as intended.

But if I open the html file itself seperately ( ./dist/blog/01-getting-started/index.html ):

prevPost: ./dist/blog/01-getting-started/00-micro-changelog
nextPost: ./dist/blog/01-getting-started/02-blog-collection

It somehow appends the target URL to the current URL, resulting in a 404 every time.
This behavior is imitated when building through cloudflare pages (which serves ./dist folder after building).

Are the hrefs being dynamically modified? or have I accidentally made some changes somewhere?

Activity

  1. trevortylerlee commented on Jul 18, 2024

    @trevortylerlee
    Owner

    Hi, thanks for opening this issue. I can confirm the PostNavigation.astro component is broken when deployed on Cloudflare Pages. Deployments on Vercel or Netlify are not affected by this issue.

    Astro Micro on Cloudflare Pages

    When inspected the hrefs appear to be correct and link to the post's relative URL but Cloudflare seems to be appending it to the end of the current URL.

    I also tried updating the site in astro.config.mjs but didn't notice a change.

    I'll have to investigate further or get in contact with Cloudflare support.

    EDIT: Link to Cloudflare support topic

  2. added 2 commits that reference this issue on Jul 19, 2024
  3. trevortylerlee commented on Jul 19, 2024

    @trevortylerlee
    Owner

    Should be fixed now... lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions