Menu

nuxt/server: Write Server Routes Today That Still Run on Nuxt 5
📰

nuxt/server: Write Server Routes Today That Still Run on Nuxt 5

DEV Community: node·Danny Holloran·about 13 hours ago
#eCVNtzvE
#devtonodejs#devto#dev#nuxt#server
Reading 0:00
15s threshold

Every Nuxt app with a server/ directory has a quiet dependency problem. Your API routes call defineEventHandler , getQuery , and readBody , and those come from h3. Your modules import types from nitropack . That has been fine for years, but Nuxt 5 moves to Nitro v3 and h3 v2, and both ship breaking changes. Every handler you wrote against h3 v1 is a handler you will touch during that upgrade, and every module you depend on has to cut a release before you can move.

Nuxt 4.6 is the escape hatch. It ships nuxt/server , a new import source owned by Nuxt itself, and server code written against it runs unchanged on Nuxt 4 today and Nuxt 5 later. Nothing forces you to migrate. But if you have a weekend and a handful of API routes, this is the cheapest that upgrade will ever be.

What nuxt/server actually is

Think of it as the server-side twin of nuxt/app .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.