Change8

v4.2.0

Breaking Changes
📦 nuxtView on GitHub →
1 breaking6 features🐛 2 fixes🔧 10 symbols

Summary

Nuxt 4.2 introduces AbortController support for data fetching, a new dual-view development error overlay, and experimental features like Vite Environment API and async data handler extraction for significantly reduced bundle sizes.

⚠️ Breaking Changes

  • Opting into compatibilityVersion: 5 enables future breaking changes, including the upcoming Nitro v3 integration.

Migration Steps

  1. To test Nuxt 5 features, set future.compatibilityVersion to 5 in nuxt.config.ts.
  2. To enable Vite Environment API, set experimental.viteEnvironmentApi to true.
  3. To reduce bundle size via handler extraction, set experimental.extractAsyncDataHandlers to true.
  4. To enable enhanced TypeScript DX, set experimental.typescriptPlugin to true.

✨ New Features

  • Abort control for useAsyncData: Support for AbortController signals in handlers and refresh/execute functions for request cancellation.
  • Enhanced Development Error Pages: Displays both custom error pages and a detailed technical error overlay with stack traces.
  • Experimental Vite Environment API: Support for Vite 6 architectural improvements to handle multiple environments concurrently.
  • Experimental Async Data Handler Extraction: Automatically extracts useAsyncData handlers into separate chunks to reduce client bundle size, especially for prerendered sites.
  • Experimental TypeScript Plugin Support: Integration with @dxup/nuxt for smart component renaming, Nitro route navigation, and enhanced auto-import DX.
  • Precomputed renderer dependencies: Build-time computation of renderer dependencies to improve cold start performance.

🐛 Bug Fixes

  • Eliminated edge case bugs by allowing the Vite dev server to handle multiple environments concurrently via the Environment API.
  • Removed unnecessary dependencies from kit and schema packages.

🔧 Affected Symbols

useAsyncDatauseLazyAsyncDatarefreshexecute$fetchdefineNuxtConfig@nuxt/nitro-serverexperimental.viteEnvironmentApiexperimental.extractAsyncDataHandlersexperimental.typescriptPlugin