Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-lambda used in ApolloServer.d.ts not referenced in package.json #2351

Closed
carlmanaster opened this issue Feb 21, 2019 · 2 comments · Fixed by #3242
Closed

aws-lambda used in ApolloServer.d.ts not referenced in package.json #2351

carlmanaster opened this issue Feb 21, 2019 · 2 comments · Fixed by #3242
Labels
🧬 typings Relates to TypeScript changes or improvements.

Comments

@carlmanaster
Copy link

When I run tsc on my project which includes apollo-server-lambda 2.4.2 but not aws-lambda, this error is returned:

node_modules/apollo-server-lambda/dist/ApolloServer.d.ts:1:20 - error TS2307: Cannot find module 'aws-lambda'.

1 import lambda from 'aws-lambda';

I can resolve it by
yarn add @types/aws-lambda aws-lambda

but believe that this should be done at the library level.

@carlmanaster
Copy link
Author

Problem remains on apollo-server-lambda 2.4.3.

@abernix abernix added 🖇️ lambda 🧬 typings Relates to TypeScript changes or improvements. labels Sep 1, 2019
abernix added a commit that referenced this issue Sep 1, 2019
…da`.

The typings provided by `aws-types` are used on public methods within the
`apollo-server-express` package and, therefore, must be included as direct
(not development) dependencies to ensure they are available to packages
which utilize it since we don't publish types separately (e.g. via
DefinitelyTyped).

For example, these usages:

https://github.com/apollographql/apollo-server/blob/aa3e23de9fbcde41a1bd3cca9c2eacf734bae582/packages/apollo-server-lambda/src/lambdaApollo.ts#L16-L18

https://github.com/apollographql/apollo-server/blob/aa3e23de9fbcde41a1bd3cca9c2eacf734bae582/packages/apollo-server-lambda/src/ApolloServer.ts#L100-L104

And seen in the emitted type declarations here:

https://unpkg.com/apollo-server-lambda@2.9.0/dist/ApolloServer.d.ts
https://unpkg.com/apollo-server-lambda@2.9.0/dist/lambdaApollo.d.ts

(Note the `import` statements, which must be resolvable by TypeScript!)

Fixes: #2351
abernix added a commit that referenced this issue Sep 1, 2019
* types: Add `@types/aws-lambda` as a dependency of `apollo-server-lambda`.

The typings provided by `aws-types` are used on public methods within the
`apollo-server-express` package and, therefore, must be included as direct
(not development) dependencies to ensure they are available to packages
which utilize it since we don't publish types separately (e.g. via
DefinitelyTyped).

For example, these usages:

https://github.com/apollographql/apollo-server/blob/aa3e23de9fbcde41a1bd3cca9c2eacf734bae582/packages/apollo-server-lambda/src/lambdaApollo.ts#L16-L18

https://github.com/apollographql/apollo-server/blob/aa3e23de9fbcde41a1bd3cca9c2eacf734bae582/packages/apollo-server-lambda/src/ApolloServer.ts#L100-L104

And seen in the emitted type declarations here:

https://unpkg.com/apollo-server-lambda@2.9.0/dist/ApolloServer.d.ts
https://unpkg.com/apollo-server-lambda@2.9.0/dist/lambdaApollo.d.ts

(Note the `import` statements, which must be resolvable by TypeScript!)

Fixes: #2351

* Add CHANGELOG.md entry for #3242.
@abernix
Copy link
Member

abernix commented Sep 1, 2019

Should be fixed in 2.9.3!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🧬 typings Relates to TypeScript changes or improvements.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants