-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Description
Describe the bug
Typescript 4.5.4 causes compile-time type error for try catch in examples/basic-crud-application.
To Reproduce
Run the examples/basic-crud-application/server with typescript 4.5.4
Expected behavior
"npm start" creates the following errors:
socket.io\examples\basic-crud-application\server\node_modules\ts-node\src\index.ts:513
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: ⨯ Unable to compile TypeScript:
lib/todo-management/todo.handlers.ts:52:39 - error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'string'.
52 error: sanitizeErrorMessage(e),
~
lib/todo-management/todo.handlers.ts:84:39 - error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'string'.
84 error: sanitizeErrorMessage(e),
~
lib/todo-management/todo.handlers.ts:112:39 - error TS2345: Argument of
type 'unknown' is not assignable to parameter of type 'string'.
112 error: sanitizeErrorMessage(e),
~
lib/todo-management/todo.handlers.ts:139:39 - error TS2345: Argument of
type 'unknown' is not assignable to parameter of type 'string'.
139 error: sanitizeErrorMessage(e),
~
lib/todo-management/todo.handlers.ts:154:39 - error TS2345: Argument of
type 'unknown' is not assignable to parameter of type 'string'.
154 error: sanitizeErrorMessage(e),
Platform:
- Device: PC
- OS: Windows 10
Additional context
Reverting to typescript 4.2.4 resolves issue