Skip to content

Conversation

@0815fox
Copy link

@0815fox 0815fox commented Oct 5, 2021

Newest version of tsc complains about two errors:

lib/server.ts:228:30 - error TS2352: Conversion of type 'RawData' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Type 'Buffer[]' is not comparable to type 'string'.

228 message = JSON.parse(msg as string);
~~~~~~~~~~~~~

lib/server.ts:277:30 - error TS2571: Object is of type 'unknown'.

277 message: e.message,

However, it needs to be discussed, if msg as string should be force-casted as I did for now, or if we better use the toString method. Did not find out, why, but the msg-Parameter not is of type RawData which is Buffer | ArrayBuffer | Buffer[] and not directly convertible to string anymore.

Copy link
Member

@tim-hellhake tim-hellhake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm run prettier

@0815fox
Copy link
Author

0815fox commented Oct 13, 2021

After running prettier on this branch there were no changes in the diff. Don't know why the build failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants