Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All declarations of 'stream' must have identical modifiers api-ai-javascript - Dialogflow

I am trying to integrate Dialogflow in Angular 7. I am getting this error.

  ** Angular Live Development Server is listening on localhost:4200, 
open your browser on http://localhost:4200/ **

Date: 2018-11-22T13:47:11.748Z
Hash: 4075ca64830b90f82558
Time: 4597ms
chunk {main} main.js, main.js.map (main) 1.85 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 92.4 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 16.2 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 318 kB [initial] [rendered]

ERROR in node_modules/api-ai-javascript/declarations.d.ts(39,5): error TS2687: All declarations of 'stream' must have identical modifiers.

ℹ 「wdm」: Failed to compile.
like image 829
Joel K Thomas Avatar asked Nov 22 '18 13:11

Joel K Thomas


2 Answers

I think i have been following the same tutorial and i came across the solution in this thread right here.

The section where you are busy importing the library should have this path

import { ApiAiClient } from 'api-ai-javascript/es6/ApiAiClient'

in your tsconfig.json

{
 "compileOnSave": false,
 "compilerOptions": {
   ...
   "baseUrl":"./",
   "typeRoots": ["node_modules/@types"],
   "lib": ["es2017", "dom"],
   "paths":{
      "api-ai-javascript/*":["node_modules/api-ai-javascript/es6/*]
   }
 }
}

Hope this helps, this did remove the compiling error and i was able to continue.

source

like image 162
tony2tones Avatar answered Sep 24 '22 11:09

tony2tones


I had the same error and only with below changing in import line, it fixed.

import {ApiAiClient} from 'api-ai-javascript/es6/ApiAiClient';
like image 41
Me Sa Avatar answered Sep 23 '22 11:09

Me Sa