profile
viewpoint

Ask questionsBing API changes

Hi John, I just want to draw your attention to the changes in the Bing search api (the change from Cognitive Services to Bing Search Services) which you may very well be aware of.

Unfortunately this puts a major hitch in the follow along code from Chapter 3 - or at least I'm having trouble reconfiguring the code to match the new version of the API, or creating an olde style API.

The book is still adding a great deal of value (thank you) and I'll no doubt be learning a lot trying to get passed the problem, I just wanted to let you know there is an issue.

Thanks, Chris.

johnwargo/learning-pwa-code

Answer questions WelchData

@johnwargo Chapter 3's code seems fine now, I've got a working app. The only issues that came up were with the type script compiler (see below). I'll get back to you on Chp 4 and Chp 5 as soon as I can.

Running the tsc command gave me these errors:

$ tsc ../../../../node_modules/@types/readable-stream/index.d.ts:13:15 - error TS2417: Class static side 'typeof _Readable' incorrectly extends base class static side 'typeof Readable'. The types of 'Stream.Readable.Writable' are incompatible between these types. Type 'typeof _Readable.Writable' is not assignable to type 'typeof import("stream").Writable'. Types of parameters 'options' and 'opts' are incompatible. Type 'import("stream").WritableOptions | undefined' is not assignable to type '_Readable.WritableOptions | undefined'. Type 'import("stream").WritableOptions' is not assignable to type '_Readable.WritableOptions'. Type 'WritableOptions' is not assignable to type 'WritableStateOptions'. Types of property 'defaultEncoding' are incompatible. Type 'string | undefined' is not assignable to type '"ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined'. Type 'string' is not assignable to type '"ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined'.

13 declare class _Readable extends stream.Readable { ~~~~~~~~~

../../../../node_modules/@types/readable-stream/index.d.ts:62:11 - error TS2720: Class 'Duplex' incorrectly implements class '_Readable'. Did you mean to extend '_Readable' and inherit its members as a subclass? Type 'Duplex' is missing the following properties from type '_Readable': readableEncoding, readableEnded, readableFlowing

62 class Duplex extends Writable implements /extends/_Readable, stream.Duplex { ~~~~~~

../../../../node_modules/@types/readable-stream/index.d.ts:62:11 - error TS2720: Class '_Readable.Duplex' incorrectly implements class 'import("stream").Duplex'. Did you mean to extend 'import("stream").Duplex' and inherit its members as a subclass? Type 'Duplex' is missing the following properties from type 'Duplex': readableEncoding, readableEnded, readableFlowing

62 class Duplex extends Writable implements /extends/_Readable, stream.Duplex { ~~~~~~

../../../../node_modules/@types/readable-stream/index.d.ts:104:9 - error TS2416: Property '_transform' in type 'PassThrough' is not assignable to the same property in base type 'PassThrough'. Type '<T>(chunk: T, encoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | null | undefined, callback: (error: any, data: T) => void) => void' is not assignable to type '(chunk: any, encoding: string, callback: TransformCallback) => void'. Types of parameters 'encoding' and 'encoding' are incompatible. Type 'string' is not assignable to type '"ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | null | undefined'.

104 _transform<T>(chunk: T, encoding: BufferEncoding | null | undefined, callback: (error: any, data: T) => void): void; ~~~~~~~~~~

../../../../node_modules/@types/readable-stream/index.d.ts:163:11 - error TS2720: Class '_Readable.Transform' incorrectly implements class 'import("stream").Transform'. Did you mean to extend 'import("stream").Transform' and inherit its members as a subclass? Type 'Transform' is missing the following properties from type 'Transform': readableEncoding, readableEnded, readableFlowing

163 class Transform extends Duplex implements stream.Transform {

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List