You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yt@yt:~/tmp/loader-api-and-map$ npm run astro info
> [email protected] astro
> astro info
Astro v5.8.0
Node v22.11.0
System Linux (x64)
Package Manager npm
Output static
Adapter none
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
A map object in collection entry created by Object Loader API
is broken after I getEntry it.
Specifically, the map object cannot be used with its method (e.g. entry.data.map.entries() throws an Error) and appears its all key-values are lost.
My definition of content collection and code using the entry below (src/content/config.ts, src/pages/index.astro). :
import{z,defineCollection}from"astro:content";exportconsttestCollection=defineCollection({loader(){// Simply returning a value with Map object.return[{id: 'id',map: newMap<string,string>([['foo','bar'],['hoge','fuga']])}]},schema: z.object({map: z.map(z.string(),z.string()),})})exportconstcollections={'test': testCollection,};
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
A map object in collection entry created by Object Loader API
is broken after I
getEntry
it.Specifically, the map object cannot be used with its method (e.g.
entry.data.map.entries()
throws an Error) and appears its all key-values are lost.My definition of content collection and code using the entry below (
src/content/config.ts
,src/pages/index.astro
). :What's the expected result?
The map's data are available and it's methods can be called in page.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-ppjyehzr?file=src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: