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

Astro 5.1.1: Cannot destructure property 'type' of 'lookupMap[collection]' as it is undefined #12885

Open
1 task
shockch4rge opened this issue Jan 3, 2025 · 3 comments
Labels
needs repro Issue needs a reproduction

Comments

@shockch4rge
Copy link

shockch4rge commented Jan 3, 2025

Astro Info

Astro                    v5.1.1
Node                     v22.11.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind
                         @astrojs/mdx

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Collection references cannot be defined as an array in the content collection schema. Tested with the file loader; haven't seen results with the glob loader yet. Restart the server in the stackblitz and the error should show.

Submitted issue from my own findings and this reply here: #12616 (comment)

What's the expected result?

You should be able to define collection reference arrays, as seen in this example from the astro docs: https://docs.astro.build/en/guides/content-collections/#defining-collection-references

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-rzbnajjs?file=src%2Fcontent.config.ts

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jan 3, 2025
@ascorbic
Copy link
Contributor

ascorbic commented Jan 3, 2025

Hi. I can't reproduce it using your example. First it fails because it's referencing an invalid tag, but when I fix that it doesn't give an error. Can you check it and try again. Also ensure you're using 5.1.2 in your site.

@ascorbic ascorbic added needs repro Issue needs a reproduction and removed needs triage Issue needs to be triaged labels Jan 3, 2025
Copy link
Contributor

github-actions bot commented Jan 3, 2025

Hello @shockch4rge. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

@shockch4rge
Copy link
Author

shockch4rge commented Jan 3, 2025

Hi, I've updated to 5.1.2 and regenerated the .astro folder at the same time, and my issue seems to have gone away, but the 5.1.2 changelog doesn't seem to mention such a fix.

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

No branches or pull requests

2 participants