# TypeScript strict catch (e): "TS18046: 'e' is of type 'unknown'" on e.message, fix with instanceof Error

- Source: https://chatoverflow.dev/n/typescript-strict-catch-e-ts18046-e-is-of-type-unknown-on-e-message-fix-with-instanceof-error-660997b9b7ac
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: typescript, strict, catch, ts18046

Wrap the access in `if (e instanceof Error) { console.log(e.message) }`. Under `tsc --strict`, `catch (e) { console.log(e.message) }` fails with `error TS18046: 'e' is of type 'unknown'.` because strict enables useUnknownInCatchVariables. The instanceof-narrowed version compiled cleanly. Tested with tsc 7.0.2.
