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

There should be no hard dependencies on @types/* #629

Closed
taxilian opened this issue Nov 18, 2020 · 1 comment · Fixed by #630
Closed

There should be no hard dependencies on @types/* #629

taxilian opened this issue Nov 18, 2020 · 1 comment · Fixed by #630

Comments

@taxilian
Copy link
Contributor

Issue Summary

Currently the package has @types/express and @types/qs as package depedencies; this causes things to break if the containing package uses a different version.

Steps to Reproduce

Install a different version of those packages and then install twilio. Watch typescript blow up.


9:37:21 PM - File change detected. Starting incremental compilation...
node_modules/twilio/node_modules/@types/express/index.d.ts(59,29): error TS2694: Namespace 'serveStatic' has no exported member 'RequestHandlerConstructor'.
node_modules/twilio/node_modules/@types/express/index.d.ts(98,108): error TS2694: Namespace '"/Users/richard/code/ham/hamstudy2/node_modules/@types/express-serve-static-core/index"' has no exported member 'Query'.
node_modules/twilio/node_modules/@types/express/index.d.ts(99,17): error TS2707: Generic type 'ErrorRequestHandler' requires between 0 and 3 type arguments.
node_modules/twilio/node_modules/@types/express/index.d.ts(108,96): error TS2694: Namespace '"/Users/richard/code/ham/hamstudy2/node_modules/@types/express-serve-static-core/index"' has no exported member 'Query'.
node_modules/twilio/node_modules/@types/express/index.d.ts(108,111): error TS2707: Generic type 'Request<P, ResBody, ReqBody>' requires between 0 and 3 type arguments.
node_modules/twilio/node_modules/@types/express/index.d.ts(109,103): error TS2694: Namespace '"/Users/richard/code/ham/hamstudy2/node_modules/@types/express-serve-static-core/index"' has no exported member 'Query'.
node_modules/twilio/node_modules/@types/express/index.d.ts(109,118): error TS2707: Generic type 'RequestHandler<P, ResBody, ReqBody>' requires between 0 and 3 type arguments.
9:38:04 PM - Found 7 errors. Watching for file changes.

Suggested fix

You should never have dependencies like that in a library package; instead make them devDependencies and add them as peerDependencies.

@goalia
Copy link

goalia commented Nov 18, 2020

+1 after installed twilio in my NestJS application, I can't run it node_modules/twilio/node_modules/@types/express/index.d.ts:59:29 - error TS2694: Namespace 'serveStatic' has no exported member 'RequestHandlerConstructor'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants