Closed
Description
Bug description
EDIT: see this comment for updated info after triage.
The import statement in Tracer.ts for TracerInterface
is importing all the modules from the root. https://github.com/awslabs/aws-lambda-powertools-typescript/blob/main/packages/tracer/src/Tracer.ts#L3.
I am trying to use tracer module without the need to install middy.
Expected Behavior
Should be able to use Tracer without the need to import middy when its not used.
Current Behavior
This behavior is forcing to import middy middleware
Possible Solution
import { TracerInterface } from './TracerInterface';
Steps to Reproduce
- Install tracer npm module
npm i @aws-lambda-powertools/tracer
- Import tracer
import { Tracer } from "@aws-lambda-powertools/tracer/lib/Tracer";
- Add tracer annotation and build fails with
error TS2307: Cannot find module '@middy/core' or its corresponding type declarations
.
Environment
- Powertools version used: 1.1.1
- Packaging format (Layers, npm): npm
- AWS Lambda function runtime: Node 16