astrowind icon indicating copy to clipboard operation
astrowind copied to clipboard

Cannot read properties of undefined (reading 'currentPage')

Open aluminum-ice opened this issue 1 year ago • 8 comments

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?

aluminum-ice avatar Dec 26 '24 06:12 aluminum-ice

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 avatar Dec 27 '24 16:12 blaudden

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

blaudden avatar Dec 27 '24 23:12 blaudden

I opened a discussion around this last week

https://github.com/onwidget/astrowind/discussions/571

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

ChrisHammond avatar Dec 28 '24 06:12 ChrisHammond

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

enrique-carbo avatar Dec 28 '24 14:12 enrique-carbo

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 🤣

JackTheMico avatar Jan 03 '25 07:01 JackTheMico

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 avatar Jan 07 '25 22:01 severinsm

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

severinsm avatar Jan 14 '25 20:01 severinsm

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.

enrique-carbo avatar Jan 20 '25 19:01 enrique-carbo