Effect CommunityEC
Effect Community7mo ago
11 replies
ryan

Type Issue with `unknown` Instead of `never` in Type Definition

I have a fun problem of an unknown sneaking into my type, when it really should be never, i don't think I should need to explicitly type this but i'm wondering if this is a package version issue?


const OpenidConfigMock: Layer<ApiGroup<"MyApi", "OpenIDConfig">, never, unknown>


const OpenidConfigMock = HttpApiBuilder.group(MockApi, 'OpenIDConfig', (handlers) =>
  handlers.handle(
    'openid',
    Effect.fn(function* () {
      const value = yield* Effect.succeed(openidConfigurationResponse);
      return value;
    }),
  ),
);

export { OpenidConfigMock };


I am on latest effect/platform and effect version, i checked the package.json for platform and it should be happy on this effect version

For context, the openidConfigurationResponse is an object and it's type is properly inferred it seems in my lsp.
Was this page helpful?