Open ghost opened 2 years ago
Where are you seeing this error? What's your code?
@fregante I have converted the code to Typescript
https://gist.github.com/ayanamidev/e32ea8edb5c4bd462b04ab30af9465cb
Since the type definitions are written & updated manually, I think the error from typescript compiler makes sense.
I thought I commented here. In short the error doesn't affect the final user, but PR welcome to fix the type to something more generic like new (message: string, ...args: unknown[]): Error
. The issue here is that some internal Errors don't match the Error
constructor exactly
I'm also having trouble adding my own constructor to this. It seems that:
@types/node
instead of lib.es5
MessengerError extends Error
, and Error
is reported as ErrorConstructor
, I still get:Argument of type 'typeof MessengerError' is not assignable to parameter of type 'ErrorConstructor'. Type 'typeof MessengerError' provides no match for the signature '(message?: string | undefined): Error'.
Note: The line seems to work, it's just that the types seem incorrect.
Hi, I updated to the latest version of serialize-error (11.0.0) and the support for ios 13.6 and below is gone. Getting the following error. Looks related to error constructor:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#field_declarations
That's unrelated. You'll just have to use Babel or keep using the older version.
Argument of type 'typeof MessengerError' is not assignable to parameter of type 'ErrorConstructor'. Type 'typeof MessengerError' provides no match for the signature '(message?: string | undefined): Error'.
Sorry to necro bump, I've got the exact same error (currently switched off with a ts-ignore comment). Any update on this?
This message is shown when the code is converted to Typescript.