Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Typescript builds broken due to issue in botbuilder-streaming #1894

Closed
benbrown opened this issue Jan 10, 2020 · 15 comments
Closed

Typescript builds broken due to issue in botbuilder-streaming #1894

benbrown opened this issue Jan 10, 2020 · 15 comments

Comments

@benbrown
Copy link
Contributor

There is a class definition missing from the botbuilder-streaming library that causes this error when building Botkit:

../../node_modules/botframework-streaming/lib/webSocket/browserWebSocket.d.ts(17,26): error TS2304: Cannot find name 'WebSocket'.

This currently blocks Botkit from building.

@benbrown
Copy link
Contributor Author

See: microsoft/botbuilder-js#1565

@benbrown
Copy link
Contributor Author

A fix for this is scheduled to be released next Monday.

@stevengum
Copy link

Small update, the fix is in the 4.7 branch of botbuilder-js. We have not yet released 4.7.1 as there is another fix we might take for this patch release.

roeintense added a commit to roeintense/botkit that referenced this issue Jan 17, 2020
roeintense added a commit to roeintense/botkit that referenced this issue Jan 17, 2020
…or Step Down reading. TODO: cannot test until howdyai#1894 is resolved.
@rpaddock
Copy link

Could someone provide work around steps for this issue?

@benbrown
Copy link
Contributor Author

4.7.1 will hit npm any minute which should effectively resolve this.

@stevengum
Copy link

@benbrown, @rpaddock, 4.7.1 is available on NPM.

@yingzhanguipath
Copy link

I'm getting the following build errors after upgrade botkit and botbuilder-adapter-slack. Do I have the right version? My product is broken now and needs this update. Any help are appreciated. Thanks.

package.json
"botbuilder-adapter-slack": "^1.0.7",
"botkit": "^4.6.1",

Error when "npm run build"
node_modules/botframework-streaming/lib/subscribableStream.d.ts:15:5 - error TS2416: Property '_write' in type 'SubscribableStream' is not assignable to the same property in base type 'Duplex'.
Type '(chunk: any, encoding: string, callback: (error?: Error | null | undefined) => void) => void' is not assignable to type '(chunk: any, encoding: string, callback: (err?: Error | undefined) => void) => void'.
Types of parameters 'callback' and 'callback' are incompatible.
Types of parameters 'err' and 'error' are incompatible.
Type 'Error | null | undefined' is not assignable to type 'Error | undefined'.
Type 'null' is not assignable to type 'Error | undefined'.

15 _write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
~~~~~~

node_modules/botframework-streaming/lib/webSocket/browserWebSocket.d.ts:17:26 - error TS2304: Cannot find name 'WebSocket'.

17 constructor(socket?: WebSocket);
~~~~~~~~~

Found 2 errors.

npm ls | findstr /is bot
+-- botbuilder-adapter-slack@1.0.7
| +-- botbuilder@4.7.1
| | +-- botbuilder-core@4.7.1
| | | -- botframework-schema@4.7.1 | | +-- botframework-connector@4.7.1 | | | +-- botframework-schema@4.7.1 deduped | | +-- botframework-streaming@4.7.1 | +-- botkit@4.6.1 deduped +-- botkit@4.6.1 | +-- botbuilder@4.7.0 | | +-- botbuilder-core@4.7.0 | | | -- botframework-schema@4.7.0 deduped
| | +-- botframework-connector@4.7.0 deduped
| | +-- botframework-streaming@4.7.0
| +-- botbuilder-dialogs@4.7.0
| | +-- botbuilder-core@4.7.0
| | | `-- botframework-schema@4.7.0
| +-- botframework-connector@4.7.0
| | +-- botframework-schema@4.7.0

@benbrown
Copy link
Contributor Author

@yingzhanguipath if you do a completely clean build (get rid of all your old node modules and reinstall), this should clear up since it it should grab the 4.7.1 botbuilder pacakges.

However I will also be releasing an update to botkit today that will enforce this.

@yingzhanguipath
Copy link

I tried completely clean build (deleted node_modules and dist folder, then "npm install") several times. But, I'm still getting the same issue. Please advise.

@benbrown
Copy link
Contributor Author

Strange.
Well, the new build that pins everything to 4.7.1 will be out soon!

@yingzhanguipath
Copy link

@benbrown Any update on 4.7.1?

@benbrown
Copy link
Contributor Author

It was published yesterday. This issue is resolved.

@benbrown
Copy link
Contributor Author

@yingzhanguipath the new botkit version is 4.6.2

@minhngvan
Copy link

Botkit version 4.6.2

node_modules/botframework-streaming/lib/subscribableStream.d.ts:15:5 - error TS2416: Property '_write' in type 'SubscribableStream' is not assignable to the same property in base type 'Duplex'.
  Type '(chunk: any, encoding: string, callback: (error?: Error | null | undefined) => void) => void' is not assignable to type '(chunk: any, encoding: string, callback: (err?: Error | undefined) => void) => void'.
    Types of parameters 'callback' and 'callback' are incompatible.
      Types of parameters 'err' and 'error' are incompatible.
        Type 'Error | null | undefined' is not assignable to type 'Error | undefined'.
          Type 'null' is not assignable to type 'Error | undefined'.

15     _write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void;

@beuted
Copy link

beuted commented Jul 28, 2020

I confirm I'm still seeing the issue on version "4.9.0" of botkit
botbuilder has version: "4.9.3"

Same error code but different issue in fact.
Updating "@types/node" to version "14.0.26" fixed it.

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

No branches or pull requests

6 participants