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

typescript definitions errors #618

Closed
phra opened this issue Nov 17, 2017 · 6 comments · Fixed by #619
Closed

typescript definitions errors #618

phra opened this issue Nov 17, 2017 · 6 comments · Fixed by #619
Labels
status: work in progress Twilio or the community is in the process of implementing type: bug bug in the library

Comments

@phra
Copy link
Contributor

phra commented Nov 17, 2017

Issue Summary

This package prevents typescript to work correctly due to problems with typescript definitions.

node_modules/@sendgrid/client/src/client.d.ts(37,10): error TS2714: The expression of an export assignment must be an identifier or qualified name in an ambient context.
node_modules/@sendgrid/helpers/classes/email-address.d.ts(11,3): error TS7010: 'fromData', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/@sendgrid/helpers/classes/email-address.d.ts(16,3): error TS7010: 'setName', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/@sendgrid/helpers/classes/email-address.d.ts(21,3): error TS7010: 'setEmail', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/@sendgrid/mail/src/mail.d.ts(33,10): error TS2714: The expression of an export assignment must be an identifier or qualified name in an ambient context.

Steps to Reproduce

  1. Install latest typescript
  2. Install latest @sendgrid/mail
  3. Set up a strict typescript environment

Technical details:

  • sendgrid-nodejs Version: 6.1.4
  • Node.js Version: 9.1
  • TypeScript: 2.6.1
phra added a commit to phra/sendgrid-nodejs that referenced this issue Nov 17, 2017
@thinkingserious thinkingserious added status: work in progress Twilio or the community is in the process of implementing type: bug bug in the library labels Nov 28, 2017
@demian85
Copy link

demian85 commented Dec 4, 2017

Please I need this fix ASAP!

@nitish24p
Copy link
Contributor

@demian85 in the mean time you can fork the repo, make the above fixes and them do your npm install from your master branch of the forked repo.

@phra
Copy link
Contributor Author

phra commented Dec 4, 2017

@nitish24p he can just point to my fork without creating another one..

@thinkingserious
Copy link
Contributor

Thanks @nitish24p and @phra for providing a temporary fix until we get this merged.

@demian85,

Did their solution work for you?

@demian85
Copy link

demian85 commented Dec 5, 2017

Well, not really. It's really a mindfuck for me to have slashes in the import route.
After adding dependency as yarn add phra/sendgrid-nodejs#89b988a61d0b3e8b9d19e261b3f3f9880c20f16e, I keep getting src/server/emails/emailer.ts(5,25): error TS2307: Cannot find module 'sendgrid'.
I just want the email package, but I'm not sure what I'm getting when importing...

import mailer = require('sendgrid/mail'); // what? where is mail?
import { MailData } from 'sendgrid/helpers/classes/mail'; // how to import this type?

I'd appreciate any help!

@ShaharHD
Copy link

@demian85 quick fix is to try the following:
import mailer = require('@sendgrid/mail'); // tslint:disable-line
but the library is broken right now with TS 2.6 (see #619)

Superd22 added a commit to Superd22/sendgrid-nodejs that referenced this issue Dec 23, 2017
thinkingserious added a commit that referenced this issue Jan 19, 2018
fix: update definitions for tsc 2.6, fixes #618
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: work in progress Twilio or the community is in the process of implementing type: bug bug in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants