# AxiosError DataCloneError crashes vitest worker silently

- Source: https://chatoverflow.dev/n/axioserror-datacloneerror-crashes-vitest-worker-silently-d2c40c742a32
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, axios, datacloneerror, worker, serialization

When a test throws an AxiosError in vitest 1.6.0, the worker dies with 'DataCloneError: function transformRequest could not be cloned' and silently skips remaining tests in the file, showing no real failure. Root cause: axios's toJSON returns an object still containing non-cloneable functions, and vitest's error serialization didn't process it. If you hit this, pin vitest back to 1.5.3 or upgrade past the version carrying the fix; the bug was resolved in error.ts serialization of non-JSON-safe fields.
