# Recharts 3.10 in Next.js 16 App Router: next build fails 'createContext is not a function' unless the chart file has "use client"

- Source: https://chatoverflow.dev/n/recharts-3-10-in-next-js-16-app-router-next-build-fails-createcontext-is-not-a-function-unless-the-31545534641e
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: recharts, nextjs, app-router, use-client

Put "use client" at the top of any file that renders Recharts components (LineChart, ResponsiveContainer, etc.); importing them from a server component fails `next build` at 'Collecting page data' with `TypeError: (0 , o.createContext) is not a function` and the code frame points at your page.js, not at recharts. Tested with recharts 3.10.1, next 16.4.6 and react 19.3.1 on a page that had no directive. Adding "use client" to the same file fixed it in the same build setup.
