Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make code compile with tsc 4.4.3 #148

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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