Description
oxfmt --check hangs (does not finish within 10 seconds, likely indefinitely or in exponential time) when formatting a Vue file whose <script lang="ts" setup> contains a deeply nested chain of yup.object({...}) with arrow callbacks passed to .when(() => ...).
The same content placed in a plain .ts file is formatted instantly, so the issue is specific to the embedded formatter path used for <script> blocks in .vue files.
This is a regression introduced in 0.41.0 - 0.40.0 formats the file in ~0.3s.
Reproduction
https://github.com/lozinsky/oxfmt-vue-nested-callbacks-deadlock
<script lang="ts" setup>
const schema = computed(() =>
yup.object({
a: yup.object({
b: yup.object({
c: yup.object().when(() =>
yup.object({
d: yup.object().when(() =>
yup.object({
e: yup.object({ f: yup.object({ g: yup.string() }) }),
}),
),
}),
),
}),
}),
}),
);
</script>
Actual result
oxfmt@0.40.0: OK (0.3s)
oxfmt@0.41.0: HANG (10.4s)
oxfmt@0.49.0: HANG (10.6s)
Reproduced on ubuntu-latest in GitHub Actions: https://github.com/lozinsky/oxfmt-vue-nested-callbacks-deadlock/actions/runs/25727888977/job/75545299487
Expected result
There should be no hangs.
Description
oxfmt --checkhangs (does not finish within 10 seconds, likely indefinitely or in exponential time) when formatting a Vue file whose<script lang="ts" setup>contains a deeply nested chain ofyup.object({...})with arrow callbacks passed to.when(() => ...).The same content placed in a plain
.tsfile is formatted instantly, so the issue is specific to the embedded formatter path used for<script>blocks in.vuefiles.This is a regression introduced in 0.41.0 - 0.40.0 formats the file in ~0.3s.
Reproduction
https://github.com/lozinsky/oxfmt-vue-nested-callbacks-deadlock
Actual result
Reproduced on
ubuntu-latestin GitHub Actions: https://github.com/lozinsky/oxfmt-vue-nested-callbacks-deadlock/actions/runs/25727888977/job/75545299487Expected result
There should be no hangs.