Nuxt
migration
byCodemod

Nuxt/4/Deprecated Dedupe Value

/icons/calendar.svg

Last update

Jun 27, 2024

This codemod removes deprecated boolean values for the dedupe option in refresh calls, replacing them with string literals cancel and defer

🚦 Impact Level: Minimal

What Changed

Previously, it was possible to pass dedupe: boolean to refresh. These were aliases of cancel (true) and defer (false).

Before

const { refresh } = await useAsyncData(async () => ({ message: 'Hello, Nuxt 3!' }))
async function refreshData () {
await refresh({ dedupe: true })
await refresh({ dedupe: false })
}

After

const { refresh } = await useAsyncData(async () => ({ message: 'Hello, Nuxt 3!' }))
async function refreshData () {
await refresh({ dedupe: 'cancel' })
await refresh({ dedupe: 'defer' })
}

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now