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

Cannot read properties of undefined (reading 'currentPage') #575

Open
aluminum-ice opened this issue Dec 26, 2024 · 8 comments
Open

Cannot read properties of undefined (reading 'currentPage') #575

aluminum-ice opened this issue Dec 26, 2024 · 8 comments

Comments

@aluminum-ice
Copy link

Disabling the blog through the config.yaml

apps:
  blog:
    isEnabled: false
    postsPerPage: 6

causes a TypeError:
Screenshot 2024-12-25 at 10 46 44 PM

This error began for me once I updated to astro v5.0.5. I am unsure how to resolve it. Has anyone had the same issue?

@blaudden
Copy link

Same error here. Log file says:

The collection "posts" does not exist or is empty. Ensure a collection directory with this name exists.

So it should be related to the loader not finding the content collection. In the patch which upgrades astrowind to 5, there is also a "git mv " of src/content -> src/data/.

@blaudden
Copy link

Testing with the plain AstroWind repo, it does not seem like the blog collection are able to load properly. The blog list is empty and going to one of its posts returns 404.

Local icons changed, reloading
24:26:53 watching for file changes...
The collection "post" does not exist or is empty. Ensure a collection directory with this name exists.
24:27:00 [200] / 883ms
24:27:01 [200] /_image 701ms
24:27:06 [200] /blog 33ms
24:27:10 [WARN] [router] A `getStaticPaths()` route pattern was matched, but no matching static path was found for requested path `/get-started-website-with-astro-tailwind-css`.

Possible dynamic routes being matched: src/pages/[...blog]/[category]/[...page].astro, src/pages/[...blog]/[tag]/[...page].astro, src/pages/[...blog]/[...page].astro, src/pages/[...blog]/index.astro.
24:27:10 [404] /get-started-website-with-astro-tailwind-css 16ms

@ChrisHammond
Copy link

I opened a discussion around this last week

#571

I removed pages/..blog/category to get things working

@enrique-carbo
Copy link

I have the same error when I try to upgrade from Astro version 4 to 5. Looking forward to possible solutions

@JackTheMico
Copy link

JackTheMico commented Jan 3, 2025

I had the same error here after upgrading Astro to 5. I noticed it happens when running astro dev, but it won't happen after running astro build && astro preview.

I'll just stick with Astro 4 for a while 🤣

@severinsm
Copy link

actually can I develop locally without crashing error when updating to latest astro version, ("astro": "^5.1.3") however still the issue is there:

[WARN] [router] A getStaticPaths() route pattern was matched, but no matching static path was found for requested path /123.
Possible dynamic routes being matched: src/pages/[...blog]/[category]/[...page].astro, src/pages/[...blog]/[tag]/[...page].astro, src/pages/[...blog]/[...page].astro, src/pages/[...blog]/index.astro.
[404] /123 7ms

@severinsm
Copy link

I've solved it, updated and copied code again from source and noticed indeed the extra folder when upgrading to astro 5.

@enrique-carbo
Copy link

I was able to upgrade to Astro 5, and I also updated some dependencies and integrations except for React. I think this latest React update was causing the problems. In the future I will try to update the React integration to see if everything behaves well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants