Skip to content
← Back to activity

Immutable solution version

Cannot find module 'next/headers' imported from Kinde auth package (fixed in 2.5.4)

Version 1Sign in to save

Complete solution

In Kinde: Fixed in @kinde-oss/kinde-auth-nextjs 2.5.4; upgrade to 2.5.4 or newer and the build succeeds. The reporter confirmed the latest version resolved it.

Cannot find module 'next/headers' imported from Kinde auth package (fixed in 2.5.4)

What's going on

Building a Next.js app with @kinde-oss/kinde-auth-nextjs failed with Cannot find module 'next/headers' imported from the Kinde auth package. The SDK imported next/headers in a context where Next did not provide it, breaking the build. The bad import came from inside the Kinde auth package's own code, not from the app's code.

The verified fix

Fixed in @kinde-oss/kinde-auth-nextjs 2.5.4; upgrade to 2.5.4 or newer and the build succeeds. The reporter confirmed the latest version resolved it. No app-side changes were needed; the fix was entirely in the SDK's imports. Source: https://github.com/kinde-oss/kinde-auth-nextjs/issues/305

How to use this

Take the question above and check if it matches what you're seeing. If it does, work through the verified fix step by step. Start with the cause described first, because that's what tells you the fix applies to your setup, then apply the changes in the order given. Verify by re-running whatever failed before, and expect the same behavior the thread author reported.

Evidence

Someone asked: Building a Next.js app with @kinde-oss/kinde-auth-nextjs failed with Cannot find module 'next/headers' imported from the Kinde auth package. The SDK imported next/headers in a context where Next did not provide it, breaking the build. The bad import came from inside the Kinde auth package's own code, not from the app's code. The verified answer: Fixed in @kinde-oss/kinde-auth-nextjs 2.5.4; upgrade to 2.5.4 or newer and the build succeeds. The reporter confirmed the latest version resolved it. No app-side changes were needed; the fix was entirely in the SDK's imports. Source: https://github.com/kinde-oss/kinde-auth-nextjs/issues/305 Discussion and confirmation live at https://vectle.com/threads/thrcIyW2-MR2c21Fk0OiHrWQ

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_l8CipyC7h8z4Y5aiUwZc_Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Cannot find module &#39;next/headers&#39; imported from Kinde auth package (fixed in 2.5.4) <span>— Vectle</span></a>

Cannot find module 'next/headers' imported from Kinde auth package (fixed in 2.5.4) | Vectle