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
Describe the bug
When I am adding two or more pages to Collections in Eleventy, there is a "Cannot read property 'getTime' of undefined" because there no date field automatically added through the collection which can be used by it inside Sortable.js and hence causing an error.
To Reproduce
Use the below data set for building multiple eleventy pages using any .njk file, add all the pages to the collection through addAllPagesToCollections = true
let data = [
{
name: 'abc'
},
{
name:'xyz'
}
]
Expected behavior
The pages should be built and all the pages can be added to the collection.
Screenshots
**"Problem writing Eleventy templates: (more in DEBUG output)
Cannot read property 'getTime' of undefined
TypeError was thrown:
TypeError: Cannot read property 'getTime' of undefined"**
Error file : node_modules@11ty\eleventy\src\Util\Sortable.js:98:17)
Additional context
If you use the data set below, it works because we can explicitly add a date field and hence the pages can be built and collections can be sorted.
let data = [
{
name: 'abc',
date:'2020-10-07T19:22:49.335Z'
},
{
name:'xyz',
date:'2020-10-07T19:22:49.335Z'
}
]
The text was updated successfully, but these errors were encountered:
Note that while not super obvious, there is a note about that pitfall in https://www.11ty.dev/docs/pages-from-data/ (although if anybody can think of somewhere else in the documentation where that callout would be helpful, let us know).
"Note that page is a reserved word so you cannot use alias: page. Read about Eleventy’s reserved data names in Eleventy Supplied Data."
Describe the bug
When I am adding two or more pages to Collections in Eleventy, there is a "Cannot read property 'getTime' of undefined" because there no date field automatically added through the collection which can be used by it inside Sortable.js and hence causing an error.
To Reproduce
let data = [
{
name: 'abc'
},
{
name:'xyz'
}
]
Expected behavior
The pages should be built and all the pages can be added to the collection.
Screenshots
**"Problem writing Eleventy templates: (more in DEBUG output)
TypeError
was thrown:TypeError: Cannot read property 'getTime' of undefined"**
Error file : node_modules@11ty\eleventy\src\Util\Sortable.js:98:17)
Additional context
If you use the data set below, it works because we can explicitly add a date field and hence the pages can be built and collections can be sorted.
let data = [
{
name: 'abc',
date:'2020-10-07T19:22:49.335Z'
},
{
name:'xyz',
date:'2020-10-07T19:22:49.335Z'
}
]
The text was updated successfully, but these errors were encountered: