Layer type mismatch and Effect.runFork issue in an Express-based app

I have a layer of type

Layer.Layer<never, ConfigError, Requester | Express>


This is an express "app" and I have all my "routes" like so

const AppLive = ServerLive.pipe(
  Layer.provide(Express.Live),
  Layer.merge(AuthenticateLive),
  Layer.merge(AuthorizeLive),
  Layer.merge(UserInfoLive),
);


Right now i've only been implementing AuthenticateLive. AuthenticateLive utilizes a Requester service that i've written.

So now this AppLive type is upset.

AppLive: Layer.Layer<never, ConfigError, Requester | Express>


When I pass AppLive to

Effect.runFork(Layer.launch(AppLive))


I get

Argument of type 'Effect<never, ConfigError, Requester | Express>' is not assignable to parameter of type 'Effect<never, ConfigError, never>'.
  Type 'Requester | Express' is not assignable to type 'never'.
    Type 'Requester' is not assignable to type 'never'.


So my thought is, somehow i need to tell Layer.launch about Requester? Or have i gone about this thought the wrong way?
Was this page helpful?