getbrevo / brevo-node

A fully-featured JavaScript API client to interact with Brevo.
https://developers.brevo.com/
ISC License
60 stars 7 forks source link

Could not find a declaration file for module '@getbrevo/brevo'. #6

Open getaaron opened 1 year ago

getaaron commented 1 year ago

When I require the Node SDK:

const brevo = require('@getbrevo/brevo')

I get this error:

Could not find a declaration file for module '@getbrevo/brevo'. '/project/node_modules/@getbrevo/brevo/src/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/getbrevo__brevo` if it exists or add a new declaration (.d.ts) file containing `declare module '@getbrevo/brevo';`ts(7016)
module "/project/node_modules/@getbrevo/brevo/src/index"
No quick fixes available

@types/getbrevo__brevo obviously doesn't exist — how should this be resolved?

shubhamUpadhyayInBlue commented 1 year ago

Hi @getaaron I guess you are trying to use it in your TS project but we don't currently support types in this package. There is already a discussion going on here.

getaaron commented 1 year ago

@shubhamUpadhyayInBlue my project is not a TS project. It’s just plain JS.

shubhamUpadhyayInBlue commented 1 year ago

Hi @getaaron I think that your IDE (Eg: VS Code, etc.) might have some settings due to which it is considering it as a TS project. I found error similar to yours in one of the blog posts. They face the same error.

Otherwise, for plain NodeJS projects I don't think this error makes much sense, I mean it should not occur.

dkrest1 commented 1 year ago

When I require the Node SDK:

const brevo = require('@getbrevo/brevo')

I get this error:

Could not find a declaration file for module '@getbrevo/brevo'. '/project/node_modules/@getbrevo/brevo/src/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/getbrevo__brevo` if it exists or add a new declaration (.d.ts) file containing `declare module '@getbrevo/brevo';`ts(7016)
module "/project/node_modules/@getbrevo/brevo/src/index"
No quick fixes available

@types/getbrevo__brevo obviously doesn't exist — how should this be resolved?

has anything be done to this