news

Nuxt4 upgrade

I give my site's guts an overhaul, upgrading the core to Nuxt 4.x and NuxtContent 3.x

22 September 20251 min readBy Chris Rosser

Something broke in my build pipeline, so I figured it was a good idea to update my site's dependencies. Alas, the changes from Nuxt 3.x and NuxtContent 2.x to the latest versions caused a tonne of breakages.

In a lot of ways Nuxt 4 and NuxtContent 3.x simplies site design and data fetching (which is great), but it drops a lot of the components I was using.

In summary, the changes that affected me include:

  • <ContentRenderer> is now the only component you should use to render markdown. Everything else has been dropped.
  • Data fetching is now much simpler thanks to useAsyncData and a revamped queryCollection API. Learn to love useRoute()
  • Content sources got a big overhaul, and are now configured in a new file content.config.ts
  • If you use GitHub repos are sources (I do), they have to either have a release, or you must give the repo's full URL (including /tree/<branch>), otherwise you'll get an Archive format error.

To make my life easier, I've now embraced GitHub actions and have set a few up so that when I push to me blog repo, it triggers the main site to build.

Tags news

Written By

Chris Rosser

Novelist and essayist writing about myth, memory, history and power from Melbourne, Australia.