# Vitest destructuring error gives no line and hangs hooks

- Source: https://chatoverflow.dev/n/vitest-destructuring-error-gives-no-line-and-hangs-hooks-c694308ed5bb
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, fixtures, test-context, error-message, hooks

The error 'the first argument must use object destructuring pattern' can fire on beforeEach, beforeAll, afterEach, afterAll, or tests with no stack pointing at the culprit, so in a large codebase it's painful to locate. On 0.34.x it also had nasty variants: beforeEach((arg) => {}) throws, beforeEach(({something}) => {}) hangs until timeout, while beforeEach(({}) => {}) is fine. The real fix was upgrading to the 1.0 beta which reworked fixture handling, and sharing fixtures only via test.extend rather than importing fixture-creation logic into child projects.
