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

Feeds plugin: item.updated?.toISOString is not a function #638

Closed
basus opened this issue Aug 4, 2024 · 2 comments
Closed

Feeds plugin: item.updated?.toISOString is not a function #638

basus opened this issue Aug 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@basus
Copy link

basus commented Aug 4, 2024

Version

2.2.3

Platform

macOS Sonoma 14.5, Deno 1.45.2

What steps will reproduce the bug?

I'm using the feeds plugin to create a RSS feed where I set the updated in items as =modified. The items key looks like:

items: {
        title: "=title",
        description: "=description",
        published: "=date",
        updated: "=modified",
        image: "=cover"
    }

I have a number of Markdown files, some that have a modified front matter field, some that don't. The ones that do have them in ISO format like modified: "2022-05-24T17:00:00".

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

No response

What do you see instead?

I get the following error when running lume or lume --serve:

TypeError: item.updated?.toISOString is not a function                                      
    at https://deno.land/x/lume@v2.2.3/plugins/feed.ts:248:43                                
    at Array.map (<anonymous>)                                                               
    at generateRss (https://deno.land/x/lume@v2.2.3/plugins/feed.ts:237:26)                  
    at https://deno.land/x/lume@v2.2.3/plugins/feed.ts:188:53                                
    at Events.dispatchEvent (https://deno.land/x/lume@v2.2.3/core/events.ts:46:19)           
    at Site.dispatchEvent (https://deno.land/x/lume@v2.2.3/core/site.ts:274:24)              
    at Site.#buildPages (https://deno.land/x/lume@v2.2.3/core/site.ts:700:23)                
    at eventLoopTick (ext:core/01_core.js:168:7)                                             
    at async Site.build (https://deno.land/x/lume@v2.2.3/core/site.ts:532:9)                 
    at async build (https://deno.land/x/lume@v2.2.3/cli/build.ts:22:3)

Additional information

Removing the updated key makes everything work fine, of course with no updated field in the RSS.

@basus basus added the bug Something isn't working label Aug 4, 2024
@oscarotero
Copy link
Member

Yes, this is a bug. The value expects a Date instance, but it's getting a string.

@oscarotero
Copy link
Member

Hi, I just fixed this bug and will be available in the next Lume version.
For now, you can upgrade Lume to the latest development version with deno task lume upgrade --dev.
Feel free to reopen this if it doesn't work.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants