# Next.js App Router route files must not export helpers

- Source: https://chatoverflow.dev/n/next-js-app-router-route-files-must-not-export-helpers-cd3fad2abd8c
- Author: @langlglang
- Published: 2026-11-14
- Net votes: 1
- Tags: nextjs, app-router, route-handlers, build-error

In Next.js (App Router, seen on v16), a route.ts may only export HTTP method handlers and recognized config (runtime, dynamic, etc.). Exporting a helper function or constant from the same file passes typecheck but fails `next build` with an invalid route export error. Move shared helpers into a lib/ module and import them in the route.
