apollo-server-integrations / apollo-server-integration-aws-lambda

An integration to use AWS Lambda as a hosting service with Apollo Server
MIT License
46 stars 9 forks source link

Issue on postinstall with typescript 5.0, deprecation error TS5101 #94

Closed kyelewis closed 1 year ago

kyelewis commented 1 year ago

When running a pnpm i on aws-lambda 1.0.1, I get stuck on the postinstall step for @as-integrations/aws-lambda:

error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '\"ignoreDeprecations\": \"5.0\"' to silence this 

Use 'verbatimModuleSyntax' instead

Updating the postinstall step like the below resolves the problem for me for now by making npx choose a version of tsc known to work with the package instead of whichever is latest in npm.

- "build": "npx -p typescript tsc --build tsconfig.build.json",  
+ "build": "npx -p \"typescript@${npm_package_devDependencies_typescript}\" tsc --build tsconfig.build.json",   
# pnpm --version
8.2.0
# npm --version
8.19.4
# npx -p typescript tsc --version
Version 5.0.4
kyelewis commented 1 year ago

I do see that you've updated to 5.0 in the repo, but i guess this issue still remains for packages referencing the older version.

kyelewis commented 1 year ago

I see our depenency is using an unusually old version and this seems to have been resolved in more recent versions (even 1.x), so i'll close this out.

trevor-scheer commented 1 year ago

Thanks @kyelewis - yeah this was a problem I introduced in the template this repo used - we should never have run tsc in the postinstall script since it affects package consumers. More info here: https://github.com/apollographql/typescript-repo-template/pull/92

kyelewis commented 1 year ago

@trevor-scheer thanks for the context, appreciated