···261261File snapshot matchers must be `async` — `toMatchFileSnapshot` returns a `Promise`. Remember to `await` the result in the matcher and in your test.
262262:::
263263264264+::: warning
265265+When custom inline snapshot matcher is aynchronous, Vitest cannot automatically infer the call location for inline snapshot rewriting. You must capture the call site by setting the `'error'` flag on the chai assertion object:
266266+267267+```ts
268268+import { expect, chai, Snapshots } from 'vitest'
269269+270270+const { toMatchInlineSnapshot } = Snapshots
271271+272272+expect.extend({
273273+ async toMatchTransformedInlineSnapshot(received: string, inlineSnapshot?: string) {
274274+ // capture call site synchronously at the top of matcher implementation
275275+ chai.util.flag(this.assertion, 'error', new Error())
276276+ const transformed = await transform(received)
277277+ return toMatchInlineSnapshot.call(this, transformed, inlineSnapshot)
278278+ },
279279+})
280280+```
281281+282282+:::
283283+264284For TypeScript, extend the `Assertion` interface:
265285266286```ts