Effect CommunityEC
Effect Community3y ago
8 replies
Peppineddu5

Error in Parsing URL: Type Mismatch

Morning, I'm having an error that I think is super stupid but I have no idea how to fix it.

const Url = S.string.pipe(S.nonEmpty(), S.maxLength(2_097_152))


const safeError = <E, T>(ei: Either.Either<E, T>) =>
  Either.match(ei, {
    onLeft: (left) => Effect.succeed(left),
    onRight: (right) => Effect.fail(right)
  })

const eiUrl = S.parseEither(Url)('test')

const url = safeError(eiUrl)
/*
Argument of type

Either<ParseError, string>
is not assignable to parameter of type

Either<unknown, unknown>
*/
Was this page helpful?