Skip to content
JS
TypeScript error

TS2851

The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method,...

Reference entryTypeScriptFetched
The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'.
As listed by TypeScript diagnosticMessages.json

{0}, {1} and so on are filled in by the compiler.

Category
Error
Severity
error
or press Cmd/Ctrl + Enter. The text is only sent to this site to match it.
Source: TypeScript diagnosticMessages.json. Data fetched 2026-09-25T01:43:12.674Z.