dialogflow / dialogflow-nodejs-client

Node.js SDK for Dialogflow
Apache License 2.0
658 stars 287 forks source link

Typescript issue building index.d.ts #44

Closed katzdave closed 7 years ago

katzdave commented 7 years ago

With typescript version 2.1.6:

node_modules/apiai/index.d.ts(25,5): error TS2666: Exports and export assignments are not permitted in module augmentations.

sstepashka commented 7 years ago

Hi, How to reproduce?

$ ./node_modules/typescript/bin/tsc ./typescript_examples/text_request.ts # no errors
$ ./node_modules/typescript/bin/tsc --v 
Version 2.1.6
katzdave commented 7 years ago

Ah, this seems to only be an issue for me when the package is referenced as a dependency.

I forked to reproduce. https://github.com/katzdave/api-ai-node-js https://github.com/katzdave/api-ai-node-js/commit/bb5443e4f7bc33479640831cec6c4a6ed1e0f7ee

npm install tsc typescript_examples/text_request.ts node_modules/apiai/index.d.ts(25,5): error TS2666: Exports and export assignments are not permitted in module augmentations.

danvk commented 7 years ago

FWIW I get a different error with TypeScript 2.2.1:

node_modules/apiai/index.d.ts(24,16): error TS2649: Cannot augment module 'apiai' with value exports because it resolves to a non-module entity.
sstepashka commented 7 years ago

@katzdave WTF? You add "apiai" as dependency to "apiai" project? I don't understand what you mean...

I have made example https://github.com/sstepashka/apiai-node-js-example and I've updated library to 4.0.1 version. please update library and try to check for error.

@danvk your error should be fixed with update.

katzdave commented 7 years ago

I had it as a dependency in another project, I just forked that one so you could clone and reproduce the error easily.

4.0.1 fixes my issue too, thanks!