-
-
Notifications
You must be signed in to change notification settings - Fork 440
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What version of Effect is running?
3.19.3, platform 0.74.0, platform-node 0.70.0
What steps can reproduce the bug?
-
Create a middleware with
HttpApiBuilder.middlewarethat makes use ofHttpRouter.RouterContextaccording to type definition this is fine.const middleware = HttpApiBuilder.middleware((app) => Effect.gen(function* () { console.log('in the middleware); const ctx = yield* HttpRouter.RouteContext; console.log( `Context route for metrics middleware: ${ctx.route.method} ${ctx.route.path}`, ); return yield* app; }), ); -
Include the middleware in the app
HttpApiBuilder.serve().pipe(Layer.provide(apiLayer), Layer.provide(middleware)) -
Run and make any request
What is the expected behavior?
The middleware gets the context, logs it. The same middleware works perfectly fine with HttpRouter.
What do you see instead?
The servers fails with 500. Further debugging showed that yielding HttpRouter.RouteContext fails as the tag is not available in the context.
Additional information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working