astro-paper icon indicating copy to clipboard operation
astro-paper copied to clipboard

i tried to generate. idk what's wrong

Open fountainpen opened this issue 2 years ago • 8 comments

▶ src/pages/index.astro
  └─ /index.html (+73ms)
λ src/pages/rss.xml.ts
 error   [RSS] Invalid or missing options:
  Invalid input (items)
  File:
    src/pages/rss.xml.ts
  Stacktrace:
Error: [RSS] Invalid or missing options:
Invalid input (items)
    at validateRssOptions (file:///C:/Users/Parsifal/astro-paper-3.0.0/node_modules/.pnpm/@[email protected]/node_modules/@astrojs/rss/dist/index.js:46:26)
    at async getRssString (file:///C:/Users/Parsifal/astro-paper-3.0.0/node_modules/.pnpm/@[email protected]/node_modules/@astrojs/rss/dist/index.js:38:31)
    at async getRssResponse (file:///C:/Users/Parsifal/astro-paper-3.0.0/node_modules/.pnpm/@[email protected]/node_modules/@astrojs/rss/dist/index.js:30:21)
    at async callEndpoint (file:///C:/Users/Parsifal/astro-paper-3.0.0/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/astro/dist/core/endpoint/index.js:105:16)
    at async #tryRenderRoute (file:///C:/Users/Parsifal/astro-paper-3.0.0/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/astro/dist/core/pipeline.js:108:24)
    at async BuildPipeline.renderRoute (file:///C:/Users/Parsifal/astro-paper-3.0.0/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/astro/dist/core/pipeline.js:46:20)
    at async generatePath (file:///C:/Users/Parsifal/astro-paper-3.0.0/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/astro/dist/core/build/generate.js:410:16)
    at async generatePage (file:///C:/Users/Parsifal/astro-paper-3.0.0/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/astro/dist/core/build/generate.js:231:5)
    at async generatePages (file:///C:/Users/Parsifal/astro-paper-3.0.0/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/astro/dist/core/build/generate.js:144:9)
    at async staticBuild (file:///C:/Users/Parsifal/astro-paper-3.0.0/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/astro/dist/core/build/static-build.js:85:7)

fountainpen avatar Oct 23 '23 12:10 fountainpen

is this the repo that threw that error? https://github.com/fountainpen/astro-paper

if so, I'm pretty sure you just named something wrong in your post schema. pubDate is a required parameter, but it's named pubDatetime in your repo.

jbrr avatar Nov 01 '23 21:11 jbrr

isnt it the problem in rss????

fountainpen avatar Nov 02 '23 05:11 fountainpen

yes, your content doesn't match the schema for an rss feed item, so it blows up when you try to create a feed. did you look in the astro source code at the file and line number from the first line of the stack trace?

did you try changing the name of that attribute?

jbrr avatar Nov 02 '23 06:11 jbrr

ohh, i'm sorry @fountainpen, I didn't realize that attribute was named wrong in this repo. i had assumed that was a custom schema you had put together for some reason 🤦‍♂️

jbrr avatar Nov 02 '23 06:11 jbrr

so basically there should be a ull request to fix that, huh? if yes, pls make it.

fountainpen avatar Nov 02 '23 06:11 fountainpen

it seems easy enough, but i can't replicate your issue. when you say you "tried to generate," do you mean you ran the astro build command?

jbrr avatar Nov 02 '23 06:11 jbrr

it seems easy enough, but i can't replicate your issue. when you say you "tried to generate," do you mean you ran the astro build command?

that's right

fountainpen avatar Nov 02 '23 07:11 fountainpen

I think I might be wrong. That parameter is actually changed to the proper pubDate before it's sent to the @astro/rss library: https://github.com/satnaing/astro-paper/blob/main/src/pages/rss.xml.ts#L18

Since I can't replicate the issue, and because I'm pretty busy at work right now, I don't think I'll have the time to dig into it any further, but I hope you figure it out!

jbrr avatar Nov 02 '23 15:11 jbrr

Couldn't reproduce this issue. I'll close this one for now. You can reopen or create new if you still have problems.

satnaing avatar Jul 16 '24 15:07 satnaing