Skip to content

"Intersection results could not be merged" does not mention the cause #3194

Discussion options

You must be logged in to vote

from what I can see the problem code is this:

import { rssSchema } from "@astrojs/rss"

const rssSchemaStrict = rssSchema.and(
    z.object( {
        link: z
            .string()
            .transform( ( link ) =>
                link.replace( /^src\/content/, "" ).replace( /index.mdx$/, "" ),
            ),
        pubDate: z.date(),
        title: z.string(),
    } ),
)

it seems that rssSchema is of type ZodEffect, so that means it has a transform or something at the end of the schema which makes it not an object schema, which means it can't be used with .and()

I suggest you use the schema from here instead:
https://github.com/withastro/astro/blob/main/packages/astro-rss/src/schema.ts

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@JoshuaKGoldberg
Comment options

@JoshuaKGoldberg
Comment options

@JacobWeisenburger
Comment options

@JoshuaKGoldberg
Comment options

Answer selected by JacobWeisenburger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3175 on January 27, 2024 02:29.