Skip to content

Typescript 4.5.4 breaks basic crud example #4213

@cbliss10

Description

@cbliss10

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions