Skip to content

Consider unpinning @types/aws-lambda #2965

@G-Rath

Description

@G-Rath

I'm happy to do a PR for this but wanted to check first that it would be accepted since pinning is often done for a reason.

Having the type package pinned makes it harder for us to do updates downstream and makes it very easy to cause type errors due to the package declaring a class in its global namespace meaning typescript errors if you have different versions:

❯ npm ls @types/aws-lambda
[email protected] /home/person/workspace/my-app
├─┬ @sentry/[email protected]
│ ├─┬ @opentelemetry/[email protected]
│ │ └── @types/[email protected]
│ └── @types/[email protected] deduped
└── @types/[email protected]

❯ nrun typecheck
> nrun.js typecheck
> tsc -p . --noEmit

node_modules/@opentelemetry/instrumentation-aws-lambda/node_modules/@types/aws-lambda/handler.d.ts:219:15 - error TS2300: Duplicate identifier 'HttpResponseStream'.

219         class HttpResponseStream extends Writable {
                  ~~~~~~~~~~~~~~~~~~

  node_modules/@types/aws-lambda/handler.d.ts:220:15
    220         class HttpResponseStream extends Writable {
                      ~~~~~~~~~~~~~~~~~~
    'HttpResponseStream' was also declared here.

node_modules/@types/aws-lambda/handler.d.ts:220:15 - error TS2300: Duplicate identifier 'HttpResponseStream'.

220         class HttpResponseStream extends Writable {
                  ~~~~~~~~~~~~~~~~~~

  node_modules/@opentelemetry/instrumentation-aws-lambda/node_modules/@types/aws-lambda/handler.d.ts:219:15
    219         class HttpResponseStream extends Writable {
                      ~~~~~~~~~~~~~~~~~~
    'HttpResponseStream' was also declared here.


Found 2 errors in 2 files.

Errors  Files
     1  node_modules/@opentelemetry/instrumentation-aws-lambda/node_modules/@types/aws-lambda/handler.d.ts:219
     1  node_modules/@types/aws-lambda/handler.d.ts:220

If the dependency constraint was relaxed to allow patch versions, package managers would be able to deduplicate the version so that this doesn't happen, and meaning consumers would not be dependent on open-telemetry actively ensuring their version constraint is on the latest version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions